Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit ddb4e6e

Browse files
Add a few lint rules, set line-length to 120 (#23)
* Remove unused imports * Add __all__ * Max line length * New rules * Fix linting errors * Update pre-commit hook * Move __all__ definition
1 parent a84b0db commit ddb4e6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+322
-836
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,11 @@ repos:
88
- id: ruff-format
99
args: ["--diff", "src", "tests"]
1010
- id: ruff
11-
args: ["--select", "I", "src", "tests"]
11+
args: ["src", "tests"]
1212

1313
- repo: https://github.com/PyCQA/doc8
1414
rev: 0.10.1
1515
hooks:
1616
- id: doc8
1717
additional_dependencies:
1818
- toml
19-
20-
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
21-
rev: v2.10.0
22-
hooks:
23-
- id: pretty-format-java
24-
args: [--autofix, --aosp]
25-
files: ^.*\.java$

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import toml
1414

15-
1615
# -- Project information -----------------------------------------------------
1716

1817
project = "betterproto"

pyproject.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,25 @@ rust-codec = ["betterproto-rust-codec"]
5353
[tool.ruff]
5454
extend-exclude = ["tests/output_*"]
5555
target-version = "py38"
56+
line-length = 120
57+
58+
[tool.ruff.lint]
59+
select = [
60+
"F401", # Unused imports
61+
"F841", # Unused local variables
62+
"F821", # Undefined names
63+
"E501", # Line length violations
64+
65+
"SIM101", # Simplify unnecessary if-else blocks
66+
"SIM102", # Simplify return or yield statements
67+
"SIM103", # Simplify list/set/dict comprehensions
68+
69+
"I",
70+
]
71+
5672

5773
[tool.ruff.lint.isort]
5874
combine-as-imports = true
59-
lines-after-imports = 2
6075

6176
# Dev workflow tasks
6277

0 commit comments

Comments
 (0)