Skip to content

Commit

Permalink
style: trailing comma only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed May 17, 2024
1 parent 9cd5057 commit ab5e149
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
32 changes: 19 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,19 @@ nitpick = "nitpick.__main__:main"
"Issue Tracker" = "https://github.com/andreoliwa/nitpick/issues"

[tool.ruff]
# https://beta.ruff.rs/docs/settings/#ignore
# https://docs.astral.sh/ruff/settings/#line-length
line-length = 120
# https://docs.astral.sh/ruff/settings/#src
src = ["src"]
# https://docs.astral.sh/ruff/settings/#target-version
target-version = "py38"

[tool.ruff.format]
# https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma
skip-magic-trailing-comma = true

[tool.ruff.lint]
# https://docs.astral.sh/ruff/settings/#ignore
ignore = [
"ANN", # https://beta.ruff.rs/docs/rules/#flake8-annotations-ann # TODO: fix: add typing annotations (fix 249 errors and remove this ignore)
"COM", # https://beta.ruff.rs/docs/rules/#flake8-commas-com
Expand All @@ -135,26 +147,20 @@ ignore = [
"TD002", # Missing author in TO DO
"TD003", # Missing issue link on the line following this TO DO
]
# https://beta.ruff.rs/docs/settings/#line-length
line-length = 120
# https://beta.ruff.rs/docs/settings/#select
# https://docs.astral.sh/ruff/settings/#select
select = ["ALL"]
# https://beta.ruff.rs/docs/settings/#src
src = ["src"]
# https://beta.ruff.rs/docs/settings/#target-version
target-version = "py38"

# https://beta.ruff.rs/docs/rules/#flake8-quotes-q
[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"

# https://beta.ruff.rs/docs/rules/#mccabe-c90
[tool.ruff.mccabe]
# https://beta.ruff.rs/docs/settings/#max-complexity
[tool.ruff.lint.mccabe]
# https://docs.astral.sh/ruff/settings/#max-complexity
max-complexity = 10

# https://beta.ruff.rs/docs/settings/#per-file-ignores
[tool.ruff.per-file-ignores]
# https://docs.astral.sh/ruff/settings/#per-file-ignores
[tool.ruff.lint.per-file-ignores]
# keep-sorted start
# ANN https://beta.ruff.rs/docs/rules/#flake8-annotations-ann
# F401 imported but unused
Expand Down
4 changes: 1 addition & 3 deletions src/nitpick/flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ def collect_errors(self) -> Iterator[Fuss]:
def add_options(option_manager: OptionManager):
"""Add the offline option."""
option_manager.add_option(
Flake8OptionEnum.OFFLINE.as_flake8_flag(),
action="store_true",
help=Flake8OptionEnum.OFFLINE.value,
Flake8OptionEnum.OFFLINE.as_flake8_flag(), action="store_true", help=Flake8OptionEnum.OFFLINE.value
)

@staticmethod
Expand Down

0 comments on commit ab5e149

Please sign in to comment.