Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ruff lint settings into dedicated section #2073

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 42 additions & 40 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dynamic = ["version"]

[project.optional-dependencies]
dev = [
"ruff~=0.1.1", # Update periodically
"ruff~=0.1.1", # Update periodically
"coverage",
"pytest >= 4.6",
"pytest-cov",
Expand All @@ -62,7 +62,7 @@ docs = [
"pydata_sphinx_theme",
"seaborn",
"myst-nb",
"myst-parser", # Markdown in Sphinx
"myst-parser", # Markdown in Sphinx
]

[project.urls]
Expand All @@ -80,30 +80,36 @@ path = "mesa/__init__.py"

[tool.ruff]
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
# Hardcode to Python 3.9.
# Reminder to update mesa-examples if the value below is changed.
target-version = "py39"
extend-exclude = ["docs", "build"]

[tool.ruff.lint]
select = [
# "ANN", # annotations TODO
"B", # bugbear
"C4", # comprehensions
"DTZ", # naive datetime
"E", # style errors
"F", # flakes
"I", # import sorting
"ISC", # string concatenation
"N", # naming
"PGH", # pygrep-hooks
"PIE", # miscellaneous
"PLC", # pylint convention
"PLE", # pylint error
# "PLR", # pylint refactor TODO
"PLW", # pylint warning
"Q", # quotes
"RUF", # Ruff
"S", # security
"SIM", # simplify
"T10", # debugger
"UP", # upgrade
"W", # style warnings
"YTT", # sys.version
# "ANN", # annotations TODO
"B", # bugbear
"C4", # comprehensions
"DTZ", # naive datetime
"E", # style errors
"F", # flakes
"I", # import sorting
"ISC", # string concatenation
"N", # naming
"PGH", # pygrep-hooks
"PIE", # miscellaneous
"PLC", # pylint convention
"PLE", # pylint error
# "PLR", # pylint refactor TODO
"PLW", # pylint warning
"Q", # quotes
"RUF", # Ruff
"S", # security
"SIM", # simplify
"T10", # debugger
"UP", # upgrade
"W", # style warnings
"YTT", # sys.version
]
# Ignore list taken from https://github.com/psf/black/blob/master/.flake8
# E203 Whitespace before ':'
Expand All @@ -114,19 +120,15 @@ select = [
# checks for it.
# See https://github.com/charliermarsh/ruff/issues/1842#issuecomment-1381210185
extend-ignore = [
"E501",
"S101", # Use of `assert` detected
"B017", # `assertRaises(Exception)` should be considered evil TODO
"PGH004", # Use specific rule codes when using `noqa` TODO
"B905", # `zip()` without an explicit `strict=` parameter
"N802", # Function name should be lowercase
"N999", # Invalid module name. We should revisit this in the future, TODO
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` TODO
"S310", # Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
"S603", # `subprocess` call: check for execution of untrusted input
"ISC001", # ruff format asks to disable this feature
"E501",
"S101", # Use of `assert` detected
"B017", # `assertRaises(Exception)` should be considered evil TODO
"PGH004", # Use specific rule codes when using `noqa` TODO
"B905", # `zip()` without an explicit `strict=` parameter
"N802", # Function name should be lowercase
"N999", # Invalid module name. We should revisit this in the future, TODO
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` TODO
"S310", # Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
"S603", # `subprocess` call: check for execution of untrusted input
"ISC001", # ruff format asks to disable this feature
]
extend-exclude = ["docs", "build"]
# Hardcode to Python 3.9.
# Reminder to update mesa-examples if the value below is changed.
target-version = "py39"
Loading