mirror of
https://github.com/facebookresearch/fairseq.git
synced 2024-11-13 07:41:39 +03:00
355ffbe4e2
Summary: # Before submitting - [X] Was this discussed/approved via a Github issue? (no need for typos, doc improvements) - [X] Did you read the [contributor guideline](https://github.com/pytorch/fairseq/blob/main/CONTRIBUTING.md)? - [X] Did you make sure to update the docs? - [X] Did you write any new necessary tests? ## What does this PR do? Fixes https://github.com/pytorch/fairseq/issues/4300 ## PR review Anyone in the community is free to review the PR once the tests have passed. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. ## Did you have fun? Big time! Note: I had to update `black` because of [this known issue](https://github.com/psf/black/issues/2964): ``` black....................................................................Failed - hook id: black - exit code: 1 Traceback (most recent call last): File "/Users/azzhipa/.cache/pre-commit/repoxt83whf2/py_env-python3.8/bin/black", line 8, in <module> sys.exit(patched_main()) File "/Users/azzhipa/.cache/pre-commit/repoxt83whf2/py_env-python3.8/lib/python3.8/site-packages/black/__init__.py", line 1423, in patched_main patch_click() File "/Users/azzhipa/.cache/pre-commit/repoxt83whf2/py_env-python3.8/lib/python3.8/site-packages/black/__init__.py", line 1409, in patch_click from click import _unicodefun ImportError: cannot import name '_unicodefun' from 'click' (/Users/azzhipa/.cache/pre-commit/repoxt83whf2/py_env-python3.8/lib/python3.8/site-packages/click/__init__.py) ``` Pull Request resolved: https://github.com/pytorch/fairseq/pull/4344 Reviewed By: zhengwy888 Differential Revision: D35691648 Pulled By: dianaml0 fbshipit-source-id: 4bdf408bc9d9cca76c9c08e138cf85b1d00d14d4
41 lines
935 B
YAML
41 lines
935 B
YAML
exclude: 'build|stubs'
|
|
|
|
default_language_version:
|
|
python: python3
|
|
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.1.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: check-ast
|
|
- id: check-merge-conflict
|
|
- id: no-commit-to-branch
|
|
args: ['--branch=master']
|
|
- id: check-added-large-files
|
|
args: ['--maxkb=500']
|
|
- id: end-of-file-fixer
|
|
|
|
- repo: https://github.com/ambv/black
|
|
rev: 22.3.0
|
|
hooks:
|
|
- id: black
|
|
language_version: python3.8
|
|
|
|
- repo: https://gitlab.com/pycqa/flake8
|
|
rev: 3.9.2
|
|
hooks:
|
|
- id: flake8
|
|
args: [
|
|
# only error for syntax errors and undefined names
|
|
"--select=E9,F63,F7,F82",
|
|
]
|
|
|
|
- repo: https://github.com/pycqa/isort
|
|
rev: 5.10.1
|
|
hooks:
|
|
- id: isort
|
|
exclude: README.md
|
|
additional_dependencies: [toml]
|
|
args: ["--profile", "black"]
|