--- ci: autoupdate_schedule: quarterly skip: - nitpick-check # can't run on pre-commit.ci while using gh:// repos: - repo: local hooks: - id: immutable-setup-py name: Verify that setup.py stays immutable description: >- This is a sanity check that makes sure that the `setup.py` file isn't changed. # Using Python here because using # shell test does not seem to work in CIs: entry: >- sh -c 'git hash-object setup.py | python -c raise\ SystemExit\(input\(\)\ !=\ \"38cc2638672e1f6ca56e4d5ceaf16451dd702b67\"\) ' pass_filenames: false language: system files: >- ^setup\.py$ - id: immutable-tests-init-py name: Verify that tests/__init__.py stays immutable description: >- This is a sanity check that makes sure that the `tests/__init__.py` file isn't changed. # Using Python here because using # shell test does not seem to work in CIs: entry: >- sh -c 'git hash-object tests/__init__.py | python -c raise\ SystemExit\(input\(\)\ !=\ \"674d7b907efe86dafcd2b8ddc5655fc55ddf5395\"\) ' pass_filenames: false language: system files: >- ^tests/__init__\.py$ - id: enforced-flake8-version name: Verify that enforced flake8 version stays unchanged description: >- This is a sanity check and fixer that makes sure that the `flake8` version in this file remains matching the corresponding request in the `# enforce-version` comment. # Using Python here because using # shell test does not always work in CIs: entry: >- python -c 'import pathlib, re, sys; pre_commit_config = pathlib.Path(sys.argv[1]); cfg_txt = pre_commit_config.read_text(); new_cfg_txt = re.sub( r"(?P\s+)rev:\s(?:\d+\.\d+\.\d+)\s{0,2}" r"#\senforce-version:\s(?P\d+\.\d+\.\d+)" r"[ \t\f\v]*", r"\grev: \g " r"# enforce-version: \g", cfg_txt, ); cfg_txt != new_cfg_txt and pre_commit_config.write_text(new_cfg_txt) ' pass_filenames: true language: system files: >- ^\.pre-commit-config\.ya?ml$ types: - yaml - repo: https://github.com/asottile/add-trailing-comma.git rev: v3.1.0 hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade.git rev: v3.14.0 hooks: - id: pyupgrade args: - --py36-plus - repo: https://github.com/PyCQA/isort.git rev: 5.12.0 hooks: - id: isort args: - --honor-noqa - repo: https://github.com/Lucas-C/pre-commit-hooks.git rev: v1.5.4 hooks: - id: remove-tabs - repo: https://github.com/python-jsonschema/check-jsonschema.git rev: 0.27.0 hooks: - id: check-github-workflows files: ^\.github/workflows/[^/]+$ types: - yaml # yamllint disable rule:comments-indentation # - id: check-jsonschema # name: Check GitHub Workflows set timeout-minutes # args: # - --builtin-schema # - github-workflows-require-timeout # files: ^\.github/workflows/[^/]+$ # types: # - yaml # - id: check-readthedocs # yamllint enable rule:comments-indentation - repo: https://github.com/andreoliwa/nitpick.git rev: v0.34.0 hooks: - id: nitpick-check args: - -v stages: [] - repo: https://github.com/pre-commit/pygrep-hooks.git rev: v1.10.0 hooks: - id: python-check-blanket-noqa - id: python-check-mock-methods - id: python-no-eval - id: python-no-log-warn - id: rst-backticks - repo: https://github.com/pre-commit/pre-commit-hooks.git rev: v4.4.0 hooks: # Side-effects: - id: trailing-whitespace - id: check-merge-conflict - id: double-quote-string-fixer - id: end-of-file-fixer - id: requirements-txt-fixer exclude: >- ^(docs/requirements|requirements-build)\.txt$ # Non-modifying checks: - id: name-tests-test files: >- ^tests/[^_].*\.py$ - id: check-added-large-files - id: check-byte-order-marker - id: check-case-conflict # disabled due to pre-commit/pre-commit-hooks#159 # - id: check-docstring-first - id: check-json - id: check-symlinks - id: check-yaml # args: # - --unsafe - id: detect-private-key # Heavy checks: - id: check-ast - id: debug-statements - repo: https://github.com/Lucas-C/pre-commit-hooks-markup.git rev: v1.0.1 hooks: - id: rst-linter files: >- ^README\.rst$ - repo: https://github.com/PyCQA/pydocstyle.git rev: 6.3.0 hooks: - id: pydocstyle - repo: https://github.com/codespell-project/codespell.git rev: v2.2.6 hooks: - id: codespell exclude: >- ^\.github/\.json-schemas/.*\.json$ - repo: https://github.com/adrienverge/yamllint.git rev: v1.32.0 hooks: - id: yamllint files: \.(yaml|yml)$ types: [file, yaml] args: - --strict - repo: https://github.com/openstack/bashate.git rev: 2.1.1 hooks: - id: bashate args: - -i - E006 - repo: https://github.com/shellcheck-py/shellcheck-py.git rev: v0.9.0.6 hooks: - id: shellcheck - repo: https://github.com/PyCQA/flake8.git rev: 6.1.0 hooks: - id: flake8 alias: flake8-no-wps name: flake8 WPS-excluded additional_dependencies: - flake8-2020 ~= 1.7.0 - flake8-length ~= 0.3.0 - flake8-pytest-style ~= 1.6.0 language_version: python3 - repo: https://github.com/PyCQA/flake8.git # NOTE: This is kept at v4 for until WPS starts supporting flake v5. rev: 4.0.1 # enforce-version: 4.0.1 hooks: - id: flake8 alias: flake8-only-wps name: flake8 WPS-only args: - --select - WPS additional_dependencies: - wemake-python-styleguide ~= 0.16.1 language_version: python3 - repo: local hooks: - id: pylint language: system name: PyLint files: \.py$ entry: python -m pylint args: - --rcfile - .pylintrc stages: - manual - repo: https://github.com/pre-commit/mirrors-mypy.git rev: v1.5.1 hooks: - id: mypy alias: mypy-py312 name: MyPy, for Python 3.12 additional_dependencies: - lxml # requirement of `--txt-report` - pytest - Sphinx >= 3.1.2 - types-colorama - types-Pillow - types-Pygments - types-pytz - types-setuptools args: - --namespace-packages - --install-types - --non-interactive - --python-version=3.12 - --txt-report=.tox/.tmp/.mypy/python-3.12 - src/sphinxcontrib/ - tests/ pass_filenames: false - id: mypy alias: mypy-py310 name: MyPy, for Python 3.10 additional_dependencies: - lxml # requirement of `--txt-report` - pytest - Sphinx >= 3.1.2 - types-colorama - types-Pillow - types-Pygments - types-pytz - types-setuptools args: - --namespace-packages - --install-types - --non-interactive - --python-version=3.10 - --txt-report=.tox/.tmp/.mypy/python-3.10 - src/sphinxcontrib/ - tests/ pass_filenames: false - id: mypy alias: mypy-py38 name: MyPy, for Python 3.8 additional_dependencies: - lxml # requirement of `--txt-report` - pytest - Sphinx >= 3.1.2 - types-colorama - types-Pillow - types-Pygments - types-pytz - types-setuptools args: - --namespace-packages - --install-types - --non-interactive - --python-version=3.8 - --txt-report=.tox/.tmp/.mypy/python-3.8 - src/sphinxcontrib/ - tests/ pass_filenames: false - id: mypy alias: mypy-py36 name: MyPy, for Python 3.6 additional_dependencies: - importlib_metadata - lxml # requirement of `--txt-report` - pytest - Sphinx >= 3.1.2, < 6 - types-colorama - types-Pillow - types-Pygments - types-pytz - types-setuptools - types-typed-ast args: - --namespace-packages - --install-types - --non-interactive - --python-version=3.6 - --txt-report=.tox/.tmp/.mypy/python-3.6 - src/sphinxcontrib/ - tests/ pass_filenames: false ...