Skip to content

Commit

Permalink
DX!: switch to Ruff as linter (#28)
Browse files Browse the repository at this point in the history
* MAINT: apply Ruff autofixes
* MAINT: autoupdate pre-commit hooks
* MAINT: implement updates from pre-commit hooks
* MAINT: remove pylint ignore comments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: GitHub <[email protected]>
Co-authored-by: Remco de Boer <[email protected]>
  • Loading branch information
3 people authored Jul 10, 2023
1 parent 9bb1aed commit 24c4d98
Show file tree
Hide file tree
Showing 22 changed files with 198 additions and 242 deletions.
5 changes: 1 addition & 4 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
"*particle*.*ml",
".constraints/*.txt",
".editorconfig",
".flake8*",
".gitignore",
".gitpod.*",
".mypy.ini",
".pre-commit-config.yaml",
".prettierignore",
".pydocstyle*",
".pylintrc",
".readthedocs.yml",
".vscode/*",
".vscode/.gitignore",
Expand All @@ -55,7 +52,7 @@
"typings"
],
"language": "en-US",
"words": ["ComPWA", "conda", "doctests", "pdgref", "pylint", "pytest"],
"words": ["ComPWA", "conda", "doctests", "pdgref", "pytest"],
"ignoreWords": [
"MAINT",
"PYTHONHASHSEED",
Expand Down
32 changes: 0 additions & 32 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: ComPWA/actions/.github/workflows/pytest.yml@v1
with:
coverage-target: sphinxcontrib
macos-python-version: "3.7"
macos-python-version: "3.9"
specific-pip-packages: ${{ inputs.specific-pip-packages }}
style:
if: inputs.specific-pip-packages == ''
Expand Down
6 changes: 3 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ github:

vscode:
extensions:
- charliermarsh.ruff
- christian-kohler.path-intellisense
- davidanson.vscode-markdownlint
- eamodio.gitlens
- editorconfig.editorconfig
- esbenp.prettier-vscode
- garaioag.garaio-vscode-unwanted-recommendations
- github.vscode-github-actions
- ms-python.flake8
- ms-python.isort
- ms-python.pylint
- ms-python.mypy-type-checker
- ms-python.python
- ms-python.vscode-pylance
- redhat.vscode-yaml
Expand Down
19 changes: 0 additions & 19 deletions .mypy.ini

This file was deleted.

54 changes: 14 additions & 40 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_schedule: quarterly # already done by requirements-cron.yml
skip:
- flake8
- mypy
- pylint
- pyright
- taplo

Expand Down Expand Up @@ -43,7 +41,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.0.179
rev: 0.0.192
hooks:
- id: check-dev-files
args:
Expand All @@ -57,7 +55,7 @@ repos:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.15.0
hooks:
- id: blacken-docs

Expand All @@ -67,7 +65,7 @@ repos:
- id: cspell

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.1
rev: 2.7.2
hooks:
- id: editorconfig-checker
name: editorconfig
Expand All @@ -77,22 +75,8 @@ repos:
.*\.py
)$
- repo: local
hooks:
- id: flake8
name: flake8
entry: flake8
language: system
types:
- python

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
rev: v0.35.0
hooks:
- id: markdownlint

Expand All @@ -106,39 +90,29 @@ repos:
- python

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v3.0.0
hooks:
- id: prettier

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
args:
- --rcfile=.pylintrc
- --score=no
language: system
types:
- python

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.303
rev: v1.1.316
hooks:
- id: pyright

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.9.0
hooks:
- id: pyupgrade
args:
- --py36-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
hooks:
- id: ruff
args:
- --fix

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.0
hooks:
Expand Down
11 changes: 0 additions & 11 deletions .pydocstyle

This file was deleted.

33 changes: 0 additions & 33 deletions .pylintrc

This file was deleted.

13 changes: 10 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"recommendations": [
"charliermarsh.ruff",
"christian-kohler.path-intellisense",
"davidanson.vscode-markdownlint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"garaioag.garaio-vscode-unwanted-recommendations",
"github.vscode-github-actions",
"ms-python.flake8",
"ms-python.isort",
"ms-python.pylint",
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
Expand All @@ -18,5 +18,12 @@
"tamasfe.even-better-toml",
"tyriar.sort-lines",
"yzhang.markdown-all-in-one"
],
"unwantedRecommendations": [
"bungcip.better-toml",
"ms-python.flake8",
"ms-python.isort",
"ms-python.pylint",
"travisillig.vscode-json-stable-stringify"
]
}
15 changes: 7 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.enabled": true,
"coverage-gutters.coverageFileNames": ["coverage.xml"],
"coverage-gutters.coverageReportFileName": "**/htmlcov/index.html",
"coverage-gutters.showGutterCoverage": false,
"coverage-gutters.showLineCoverage": true,
"cSpell.enabled": true,
"editor.formatOnSave": true,
"editor.rulers": [88],
"files.watcherExclude": {
Expand All @@ -36,29 +36,28 @@
"**/.git/**": true,
"**/.tox/**": true
},
"flake8.importStrategy": "fromEnvironment",
"git.rebaseWhenSync": true,
"github-actions.workflows.pinned.refresh.enabled": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"isort.check": true,
"isort.importStrategy": "fromEnvironment",
"pylint.importStrategy": "fromEnvironment",
"mypy-type-checker.args": ["--config-file", "pyproject.toml"],
"mypy-type-checker.importStrategy": "fromEnvironment",
"python.analysis.autoImportCompletions": false,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.inlayHints.pytestParameters": true,
"python.analysis.typeCheckingMode": "strict",
"python.formatting.provider": "black",
"python.linting.banditEnabled": false,
"python.linting.enabled": true,
"python.linting.flake8Enabled": false,
"python.linting.mypyEnabled": true,
"python.linting.pydocstyleEnabled": true,
"python.linting.mypyEnabled": false,
"python.linting.pydocstyleEnabled": false,
"python.linting.pylamaEnabled": false,
"python.linting.pylintEnabled": false,
"python.testing.pytestArgs": ["--color=no", "--no-cov"],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"rewrap.wrappingColumn": 88,
"ruff.enable": true,
"ruff.organizeImports": true,
"search.exclude": {
"**/tests/**/__init__.py": true,
"*/.pydocstyle": true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

This package is a
[Sphinx extension](https://www.sphinx-doc.org/en/master/usage/extensions/index.html)
Expand Down
Loading

0 comments on commit 24c4d98

Please sign in to comment.