From 55191555f2575b5eb0cfc309e4d01d3a5806536d Mon Sep 17 00:00:00 2001 From: Alexander Chaika Date: Mon, 12 Feb 2024 17:12:31 +0300 Subject: [PATCH] Update linters --- .flake8 | 16 ---------------- .isort.cfg | 6 ++---- .pre-commit-config.yaml | 30 +++++++++--------------------- .prospector.yaml | 2 +- LICENSE | 2 +- pyproject.toml | 30 ++++++++++++++++++++++++++++++ pytest.ini | 2 +- 7 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 .flake8 create mode 100644 pyproject.toml diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 33a5607..0000000 --- a/.flake8 +++ /dev/null @@ -1,16 +0,0 @@ -[flake8] -exclude = - .git, - __pycache__ - semkov/settings/ -max-line-length = 120 -max-complexity = 14 -ignore = - D203 # [pydocstyle] 1 blank line required before class docstring - D212 # [pydocstyle] Multi-line docstring summary should start at the first line - D406 # [pydocstyle] Section name should end with a newline - D407 # [pydocstyle] Missing dashed underline after section - D412 # [pydocstyle] No blank lines allowed between a section header and its content - W503 # [pycodestyle] line break before binary operator - W504 # [pycodestyle] line break after binary operator - E231 # Missing whitespace after ',', ';', or ':' \ No newline at end of file diff --git a/.isort.cfg b/.isort.cfg index b9c29f6..baa484c 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,12 +1,10 @@ [settings] default_section=THIRDPARTY indent=' ' -known_pinata=pinata known_tests=pytest -sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PINATA,TESTS,LOCALFOLDER +sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,TESTS,LOCALFOLDER multi_line_output=3 line_length=120 include_trailing_comma=True use_parentheses=True -skip=venv,env,migrations,.env,.venv - +skip=venv,env,migrations,.env,.venv,__pycache__/,.pytest_cache/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa5fe4e..25819a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,16 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - - id: fix-byte-order-marker + - id: check-ast + - id: check-docstring-first - id: check-merge-conflict + - id: check-shebang-scripts-are-executable - id: debug-statements - id: detect-private-key + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: pretty-format-json + - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 @@ -16,23 +22,13 @@ repos: - repo: local hooks: - - id: isort - name: isort-local - entry: isort - language: python - types: [ python ] - exclude: .+/settings/.+ - pass_filenames: true - - id: black name: black-local entry: black language: python - language_version: python3.11 types: [python] exclude: .+/settings/.+ pass_filenames: true - - id: prospector name: prospector-local entry: prospector --messages-only @@ -41,19 +37,11 @@ repos: exclude: .+/settings/.+ pass_filenames: true - - id: bandit - name: bandit - entry: bandit - language: python - language_version: python3 - exclude: .+/tests/.+ - types: [python] - - repo: https://github.com/thibaudcolas/curlylint rev: v0.13.1 hooks: - id: curlylint types: [ file ] - files: \.html$ - language_version: python3.11.1 + files: \.(html|sls)$ + language_version: python3.11 additional_dependencies: ['click<8.1'] diff --git a/.prospector.yaml b/.prospector.yaml index 5a67e87..7f53569 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -63,4 +63,4 @@ pydocstyle: - D406 # Section name should end with a newline ('Examples', not 'Examples::') - D407 # Missing dashed underline after section ('Examples') - D412 # No blank lines allowed between a section header and its content ('Examples') - - N806 # variable in function should be lowercase (we are using `CACHE_PREFIX_KEY`) \ No newline at end of file + - N806 # variable in function should be lowercase (we are using `CACHE_PREFIX_KEY`) diff --git a/LICENSE b/LICENSE index f9f5f46..44846de 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012 Alexander Chaika, https://manti.by +Copyright (c) 2006 Alexander Chaika, https://manti.by All rights reserved. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bd07b65 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[tool.pytest.ini_options] +log_cli = true +log_cli_format = "%(levelname)s %(asctime)s %(message)s" +django_find_project = true +addopts = '-p no:warnings --color=yes --ds=db_benchmarks.core.settings' +norecursedirs = ''' +.git +''' + +[tool.black] +line-length = 120 +target_version = ['py311'] +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist +)/ +''' + +[tool.curlylint.rules] +indent = 2 +html_has_lang = true diff --git a/pytest.ini b/pytest.ini index 5fb79f8..8bf2040 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,4 +3,4 @@ DJANGO_SETTINGS_MODULE = semkov.settings.test python_classes = *Test filterwarnings = ignore::DeprecationWarning - ignore::PendingDeprecationWarning \ No newline at end of file + ignore::PendingDeprecationWarning