chore: update linters and replace black with ruff-format

This commit is contained in:
cătălin 2024-05-17 18:47:56 +02:00
commit e156ea4108
No known key found for this signature in database
3 changed files with 8 additions and 13 deletions

View file

@ -2,7 +2,7 @@ files: ^halig|tests$
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 rev: v4.6.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ] args: [ --markdown-linebreak-ext=md ]
@ -19,20 +19,14 @@ repos:
args: [ --fix=lf ] args: [ --fix=lf ]
- repo: https://github.com/charliermarsh/ruff-pre-commit - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.6 rev: v0.4.4
hooks: hooks:
- id: ruff - id: ruff
args: args:
- --fix - --fix
- --exit-non-zero-on-fix - --exit-non-zero-on-fix
- id: ruff-format
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
pass_filenames: false
args:
- "halig"
- repo: local - repo: local
hooks: hooks:

View file

@ -5,8 +5,7 @@ from halig.settings import Settings
class ICommand(ABC): class ICommand(ABC):
@abstractmethod @abstractmethod
def run(self): def run(self): ... # pragma: no cover
... # pragma: no cover
class BaseCommand(ICommand): class BaseCommand(ICommand):

View file

@ -86,8 +86,9 @@ mock_use_standalone_module = true
[tool.pyright] [tool.pyright]
reportMissingImports = false reportMissingImports = false
reportMissingTypeStubs = false reportMissingTypeStubs = false
reportAttributeAccessIssue = false
[tool.ruff] [tool.ruff.lint]
extend-select = ["W", "C90", "I", "N", "UP", "S", "BLE", "B", "A", "COM", "C4", "DTZ", "T10", "EM", "ISC", "T20", "PT", "RSE", "RET", "SIM", "PTH", "ERA", "PGH", "PL", "TRY", "RUF"] extend-select = ["W", "C90", "I", "N", "UP", "S", "BLE", "B", "A", "COM", "C4", "DTZ", "T10", "EM", "ISC", "T20", "PT", "RSE", "RET", "SIM", "PTH", "ERA", "PGH", "PL", "TRY", "RUF"]
extend-ignore = ["S101", "ISC002"] extend-ignore = ["S101", "ISC002"]
@ -95,6 +96,7 @@ extend-ignore = ["S101", "ISC002"]
python_version = "3.11" python_version = "3.11"
warn_return_any = true warn_return_any = true
warn_unused_configs = true warn_unused_configs = true
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = [ module = [
"pyrage", "pyrage",