refactor: replace darker with ruff in pre-commit hook (#100)

* refactor: replace darker with ruff in pre-commit hook

Replace the darker pre-commit hook with ruff for better performance
and enhanced features. This replaces darker, black, flake8, flynt,
isort, and pylint with ruff's linter and formatter.

- Use ruff-pre-commit (v0.15.7) with ruff and ruff-format hooks
- Add "I" (isort) rule to ruff lint config in pyproject.toml
- Preserve file scope to nepali/ and tests/ directories

Closes #99

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: centralize file scope in pyproject.toml

- Remove `files` directive from ruff pre-commit hooks
- Add `tests/**/*.py` to ruff include pattern in pyproject.toml
- File scoping now handled entirely by ruff config

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
inoovadorandClaude Opus 4.6 authored and GitHub committed 2026-04-11 12:14:16 +05:45
1 parent 3d6c448f69
commit 6e0883cf97
2 files changed
+7 -19

No files matched your search

+5 -17
View File
@@ -9,24 +9,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/akaihola/darker
rev: v2.1.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.7
hooks:
- id: darker
files: ^(nepali/|tests/)
args:
- --isort
- --flynt
- --lint=flake8 --max-line-length=88 --ignore=E203,W503
- --lint=mypy # --strict # commenting strict for now as we haven't maintained typing completely
- --lint=pylint --max-line-length=88 --disable=W0511
additional_dependencies:
- black==26.1.0
- flake8==7.3.0
- flynt==1.0.6
- isort==7.0.0
- mypy==1.19.1
- pylint==4.0.4
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/opensource-nepal/commitlint
rev: v1.13.3
+2 -2
View File
@@ -1,6 +1,6 @@
[tool.ruff]
line-length = 127
include = ["nepali/**/*.py", "pyproject.toml"]
include = ["nepali/**/*.py", "tests/**/*.py", "pyproject.toml"]
[tool.ruff.lint]
select = ["E", "W", "F"]
select = ["E", "W", "F", "I"]