Skip to content

Commit

Permalink
Add linters and update pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 24, 2024
1 parent c2b1faf commit ee3e8ef
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 19 deletions.
25 changes: 19 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [--exit-non-zero-on-fix]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
Expand All @@ -22,16 +23,28 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
exclude: ^src/em_keyboard/emojis.json$
- id: forbid-submodules
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.5
hooks:
- id: check-github-workflows
- id: check-renovate

- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
hooks:
- id: actionlint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
rev: 1.8.0
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.18
hooks:
- id: validate-pyproject

Expand Down
31 changes: 18 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,32 @@ version.source = "vcs"
local_scheme = "no-local-version"

[tool.ruff]
fix = true

[tool.ruff.lint]
select = [
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"EM", # flake8-errmsg
"F", # pyflakes errors
"I", # isort
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"EM", # flake8-errmsg
"F", # pyflakes errors
"I", # isort
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"PYI", # flake8-pyi
"RUF100", # unused noqa (yesqa)
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
# "LOG", # TODO: enable flake8-logging when it's not in preview anymore
"RUF022", # unsorted-dunder-all
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
extend-ignore = [
ignore = [
"E203", # Whitespace before ':'
"E221", # Multiple spaces before operator
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["em_keyboard"]
required-imports = ["from __future__ import annotations"]

0 comments on commit ee3e8ef

Please sign in to comment.