diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..6e7cd96 --- /dev/null +++ b/.flake8 @@ -0,0 +1,14 @@ +[flake8] +extend-ignore = + Q0, E501, C812, E203, W503, # These default to arguing with Black. We might configure some of them eventually + ANN1, # Ignore self and cls annotations + ANN204, ANN206, # return annotations for special methods and class methods + D105, D107, # Missing Docstrings in magic method and __init__ + S311, # Standard pseudo-random generators are not suitable for security/cryptographic purposes. + D401, # First line should be in imperative mood; try rephrasing + D400, # First line should end with a period + D101, # Missing docstring in public class + + # Plugins we don't currently include: flake8-return + R503, # missing explicit return at the end of function ableto return non-None value. +max-line-length=100 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e102ae9..b88c6fe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,15 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.1.0 hooks: - id: check-toml - id: check-yaml + args: [--unsafe] - id: check-merge-conflict - id: requirements-txt-fixer - id: end-of-file-fixer + - id: debug-statements + language_version: python3.10 - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -16,23 +19,31 @@ repos: - id: python-check-blanket-noqa - repo: https://github.com/psf/black - rev: 21.7b0 + rev: 22.1.0 hooks: - id: black - args: [--line-length=120] + args: [--line-length=100, --target-version=py310] + language_version: python3.10 - repo: https://github.com/pre-commit/mirrors-isort - rev: V5.9.3 + rev: V5.10.1 hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 4.0.1 hooks: - id: flake8 additional_dependencies: - flake8-annotations~=2.0 - flake8-bandit~=2.1 - flake8-docstrings~=1.5 - args: [--max-line-length=120, --ignore=ANN101 D107 ANN102 ANN206 D105 ANN204] + - flake8-bugbear + - flake8-comprehensions + - flake8-quotes + - flake8-raise + - flake8-deprecated + - flake8-print + - flake8-return + language_version: python3.10 diff --git a/README.md b/README.md index 9f01850..2f0b019 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ +