Skip to content

Commit a77ce55

Browse files
committed
Add Ruff config.
Taking from another project, settings might need tweaking. Update ignore file for Ruff.
1 parent c6bb7ee commit a77ce55

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,4 @@ debian/python*
8383
.pytest_cache
8484
Thumbs.db
8585
.mypy_cache/
86+
.ruff_cache/

pyproject.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,47 @@ filterwarnings = [
3737
"ignore::PendingDeprecationWarning:tcod.libtcodpy",
3838
"ignore:This class may perform poorly and is no longer needed.::tcod.map",
3939
]
40+
41+
[tool.ruff]
42+
# https://beta.ruff.rs/docs/rules/
43+
select = [
44+
"C90", # mccabe
45+
"E", # pycodestyle
46+
"W", # pycodestyle
47+
"F", # Pyflakes
48+
"I", # isort
49+
"UP", # pyupgrade
50+
"YTT", # flake8-2020
51+
"ANN", # flake8-annotations
52+
"S", # flake8-bandit
53+
"B", # flake8-bugbear
54+
"C4", # flake8-comprehensions
55+
"DTZ", # flake8-datetimez
56+
"EM", # flake8-errmsg
57+
"EXE", # flake8-executable
58+
"RET", # flake8-return
59+
"ICN", # flake8-import-conventions
60+
"INP", # flake8-no-pep420
61+
"PIE", # flake8-pie
62+
"PT", # flake8-pytest-style
63+
"SIM", # flake8-simplify
64+
"PTH", # flake8-use-pathlib
65+
"PL", # Pylint
66+
"TRY", # tryceratops
67+
"RUF", # NumPy-specific rules
68+
"G", # flake8-logging-format
69+
"D", # pydocstyle
70+
]
71+
ignore = [
72+
"E501", # line-too-long
73+
"S101", # assert
74+
"ANN101", # missing-type-self
75+
"D203", # one-blank-line-before-class
76+
"D204", # one-blank-line-after-class
77+
"D213", # multi-line-summary-second-line
78+
"D407", # dashed-underline-after-section
79+
"D408", # section-underline-after-name
80+
"D409", # section-underline-matches-section-length
81+
]
82+
line-length = 120
83+
target-version = "py37"

0 commit comments

Comments
 (0)