Commit 7d092896 authored by Joao Gomes's avatar Joao Gomes Committed by Facebook GitHub Bot
Browse files

OSS config for lint checks (#2066)

Summary:
Following up on [this comment ](https://github.com/pytorch/audio/pull/2056#issuecomment-988356439) I am separating the config changes from the formatting.

cc NicolasHug  mthrok

Pull Request resolved: https://github.com/pytorch/audio/pull/2066

Reviewed By: mthrok

Differential Revision: D32990377

Pulled By: jdsgomes

fbshipit-source-id: 67a6251a51901702ad10ae43c35609a09cbf5c5c
parent 34e1d24f
...@@ -112,6 +112,25 @@ jobs: ...@@ -112,6 +112,25 @@ jobs:
python .circleci/regenerate.py python .circleci/regenerate.py
git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1) git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1)
lint_python_and_config:
docker:
- image: circleci/python:3.7
steps:
- checkout
- run:
name: Install pre-commit
command: pip install --user --progress-bar off pre-commit
- run:
name: Install pre-commit hooks
command: pre-commit install-hooks
- run:
name: Lint Python code and config files
command: pre-commit run --all-files || true
- run:
name: Required lint modifications
when: on_fail
command: git --no-pager diff
download_third_parties_nix: download_third_parties_nix:
docker: docker:
- image: "pytorch/torchaudio_unittest_base:manylinux" - image: "pytorch/torchaudio_unittest_base:manylinux"
...@@ -642,6 +661,9 @@ jobs: ...@@ -642,6 +661,9 @@ jobs:
pydocstyle torchaudio pydocstyle torchaudio
workflows: workflows:
lint:
jobs:
- lint_python_and_config
build: build:
jobs: jobs:
- circleci_consistency - circleci_consistency
......
...@@ -112,6 +112,25 @@ jobs: ...@@ -112,6 +112,25 @@ jobs:
python .circleci/regenerate.py python .circleci/regenerate.py
git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1) git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1)
lint_python_and_config:
docker:
- image: circleci/python:3.7
steps:
- checkout
- run:
name: Install pre-commit
command: pip install --user --progress-bar off pre-commit
- run:
name: Install pre-commit hooks
command: pre-commit install-hooks
- run:
name: Lint Python code and config files
command: pre-commit run --all-files || true
- run:
name: Required lint modifications
when: on_fail
command: git --no-pager diff
download_third_parties_nix: download_third_parties_nix:
docker: docker:
- image: "pytorch/torchaudio_unittest_base:manylinux" - image: "pytorch/torchaudio_unittest_base:manylinux"
...@@ -642,6 +661,9 @@ jobs: ...@@ -642,6 +661,9 @@ jobs:
pydocstyle torchaudio pydocstyle torchaudio
workflows: workflows:
lint:
jobs:
- lint_python_and_config
build: build:
jobs: jobs:
- circleci_consistency - circleci_consistency
......
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-docstring-first
- id: check-toml
- id: check-yaml
exclude: packaging/.*
- id: end-of-file-fixer
- repo: https://github.com/omnilib/ufmt
rev: v1.3.0
hooks:
- id: ufmt
additional_dependencies:
- black == 21.9b0
- usort == 0.6.4
[tool.usort]
first_party_detection = false
[tool.black]
line-length = 120
target-version = ["py37"]
[tool.ufmt]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment