Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ repos:
- id: yamllint

- repo: https://github.com/asottile/blacken-docs
rev: 1.20.0
rev: 1.19.1
hooks:
- id: blacken-docs
args: [-S, -l, '120']
additional_dependencies: [black==22.12.0]
args: [--line-length=120]
additional_dependencies: [ruff>=0.14.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Repository

- Fixed Windows CI by using pip to install cppcheck (Chocolatey package is broken)
- Modernize ruff configuration to follow latest guidelines
- Remove deprecated settings (`target-version`, `ANN101`, `ASYNC1`, etc.)
- Replace `TCH` with `TC` (renamed rule set)
- Add new rule sets: `DOC`, `PYI`, `PD`
- Configure `blacken-docs` to use ruff instead of black

- Clarify where to put the settings in `pyproject.toml`
- Update GitHub Action `actions/download-artifact` to v4
Expand All @@ -33,7 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update `github.com/codespell-project/codespell` hook to v2.4.1
- Update `github.com/shellcheck-py/shellcheck-py` hook to v0.11.0.1
- Update `github.com/adrienverge/yamllint.git` hook to v1.37.1
- Update `github.com/asottile/blacken-docs` hook to 1.20.0
- Update `github.com/asottile/blacken-docs` hook to 1.19.1
- Update `github.com/astral-sh/ruff-pre-commit` hook to v0.14.10

## [v1.9.6] - 2024-06-02
Expand Down
1 change: 0 additions & 1 deletion cmake_pc_hooks/_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def _load_data_from_toml(
elements (ie. no nested sections).

Args:
namespace: Namespace to store results into
path: Path to TOML file
section: Name of section to load in TOML file
path_must_exist: Whether a missing TOML file is considered an error or not
Expand Down
32 changes: 13 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ namespaces = false

[tool.ruff]
line-length = 120
target-version = 'py310'

[tool.ruff.lint]

Expand All @@ -77,10 +76,9 @@ select = ['F', # pyflakes
'N', # pep8-naming
'D', # pydocstyle
'UP', # pyupgrade
'YTT', # flake-2020
'YTT', # flake8-2020
'ANN', # flake8-annotations
'ASYNC', # flake8-async
'ASYNC1', # flake8-trio
'S', # flake8-bandit
'BLE', # flake8-blind-except
'FBT', # flake8-boolean-trap
Expand All @@ -94,8 +92,10 @@ select = ['F', # pyflakes
'FA', # flake8-future-annotations
'ISC', # flake8-implicit-str-concat
'ICN', # flake8-import-conventions
'LOG', # flake8-logging
'G', # flake8-logging-format
'PIE', # flake8-pie
'PYI', # flake8-pyi
'PT', # flake8-pytest-style
'Q', # flake8-quotes
'RSE', # flake8-raise
Expand All @@ -104,43 +104,39 @@ select = ['F', # pyflakes
'SLOT', # flake8-slots
'SIM', # flake8-simplify
'TID', # flake8-tidy-imports
'TCH', # flake8-type-checking
'TC', # flake8-type-checking
'INT', # flake8-gettext
'ARG', # flake8-unused-arguments
'PTH', # flake8-use-pathlib
'TD', # flake8-todos
'FIX', # flake8-fixme
'ERA', # eradicate
'PD', # pandas-vet
'PL', # pylint
'TRY', # tryceratops
'FLY', # flynt
'NPY', # numpy specific rules
'PERF', # perflint
'FURB', # refurb
'LOG', # flake8-logging
'DOC', # pydoclint
'RUF', # ruff-specific rules
]

ignore = ['ANN101', # missing-type-self
'D203', # one-blank-line-before-class
'D212', # multi-line-summary-first-line
ignore = ['D203', # one-blank-line-before-class
'D212', # multi-line-summary-first-line
'S603', # subprocess-without-shell-equals-true
# Ignore rulues below are actually to prevent conflicts between formatting and linting (with fixing)
'ANN204', # missing-return-type-special-method (__init__, __new__, etc.)
'DOC201', # return-not-documented (too strict for existing codebase)
'DOC501', # raised-exception-not-documented (too strict for existing codebase)
# Ignore rules below to prevent conflicts between formatting and linting (with fixing)
# cf. https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
'COM812', # missing-trailing-comma
'COM819', # prohibited-trailing-comma
'D206', # indent-with-spaces
'E111', # indentation-with-invalid-multiple
'E114', # indentation-with-invalid-multiple-comment
'E117', # over-indented
'ISC001', # single-line-implicit-string-concatenation
'ISC002', # multi-line-implicit-string-concatenation
'Q000', # bad-quotes-inline-string
'Q001', # bad-quotes-multiline-string
'Q002', # bad-quotes-docstring
'Q003', # avoidable-escaped-quote
'S603', # subprocess-without-shell-equals-true
'W191', # tab-indentation
]

[tool.ruff.format]
Expand All @@ -151,14 +147,12 @@ skip-magic-trailing-comma = false

[tool.ruff.lint.per-file-ignores]

'tests/python/*.py' = ['S101', 'SLF001', 'PLR0913', 'PLR2004', 'D']
'tests/python/*.py' = ['S101', 'SLF001', 'PLR0913', 'PLR2004', 'D', 'DOC', 'PYI024']

[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
ignore-fully-untyped = true
mypy-init-return = true
suppress-dummy-args = true
suppress-none-returning = true

[tool.ruff.lint.flake8-quotes]
docstring-quotes = 'double'
Expand Down