mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-15 00:30:33 +03:00
As such it doesn't have access to any extra modules you installed for your program, or manually running `mypy <file>`. So, leverage `additional_dependencies` to list anything that mypy ends up complaining "that's not installed". Ref: plugins\eddn.py:40: error: Library stubs not installed for "requests" (or incompatible with Python 3.10) plugins\eddn.py:40: note: Hint: "python3 -m pip install types-requests" plugins\eddn.py:40: note: (or run "mypy --install-types" to install all missing stub packages) plugins\eddn.py:40: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports Found 1 error in 1 file (checked 1 source file)
94 lines
2.5 KiB
YAML
94 lines
2.5 KiB
YAML
# See https://pre-commit.com for more information
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
repos:
|
|
# This can be used to check how pre-commit is being run
|
|
# - repo: meta
|
|
# hooks:
|
|
# - id: identity
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: 'v4.1.0'
|
|
hooks:
|
|
- id: check-merge-conflict
|
|
- id: debug-statements
|
|
- id: end-of-file-fixer
|
|
- id: mixed-line-ending
|
|
- id: check-yaml
|
|
|
|
#- repo: https://github.com/pre-commit/mirrors-autopep8
|
|
# rev: ''
|
|
# hooks:
|
|
# - id: autopep8
|
|
|
|
### # flake8 --show-source <file>
|
|
### - repo: https://gitlab.com/pycqa/flake8
|
|
### rev: ''
|
|
### hooks:
|
|
### - id: flake8
|
|
#
|
|
# Try using local flake8
|
|
- repo: local
|
|
hooks:
|
|
- id: flake8
|
|
name: flake8
|
|
entry: flake8
|
|
language: system
|
|
types: [ python ]
|
|
|
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
|
rev: 'v1.9.0'
|
|
hooks:
|
|
- id: python-no-eval
|
|
- id: python-no-log-warn
|
|
# This is a pain where a comment begins with the word 'type' otherwise
|
|
# - id: python-use-type-annotations
|
|
|
|
# mypy - static type checking
|
|
# mypy --follow-imports skip <file>
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
rev: 'v0.931'
|
|
hooks:
|
|
- id: mypy
|
|
# verbose: true
|
|
# log_file: 'pre-commit_mypy.log'
|
|
additional_dependencies: [ types-requests ]
|
|
# args: [ "--follow-imports", "skip", "--ignore-missing-imports", "--scripts-are-modules" ]
|
|
|
|
### # pydocstyle.exe <file>
|
|
### - repo: https://github.com/FalconSocial/pre-commit-mirrors-pep257
|
|
### rev: ''
|
|
### hooks:
|
|
### - id: pep257 # docstring conventions
|
|
### # Alternate https://github.com/PyCQA/pydocstyle
|
|
|
|
# - repo: https://github.com/digitalpulp/pre-commit-php
|
|
# rev: ''
|
|
# hooks:
|
|
# -id: php-unit
|
|
|
|
# safety.exe check -r requirements.txt
|
|
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
|
|
rev: 'v1.2.3'
|
|
hooks:
|
|
- id: python-safety-dependencies-check
|
|
entry: safety
|
|
args: [check, --bare, -r]
|
|
language: system
|
|
|
|
# Check translation comments are up to date
|
|
- repo: local
|
|
hooks:
|
|
- id: LANG_comments
|
|
name: 'LANG comments'
|
|
language: system
|
|
entry: python scripts/find_localised_strings.py --compare-lang L10n/en.template --directory . --ignore coriolis-data --ignore dist.win32
|
|
pass_filenames: false
|
|
always_run: true
|
|
|
|
default_language_version:
|
|
python: python3.10
|
|
|
|
default_stages: [ commit, push ]
|
|
|
|
#files: '([^\.].+/)*.py'
|