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

Sync pyproject.toml settings with Nautobot core #141

Open
gsnider2195 opened this issue Aug 9, 2024 · 1 comment
Open

Sync pyproject.toml settings with Nautobot core #141

gsnider2195 opened this issue Aug 9, 2024 · 1 comment

Comments

@gsnider2195
Copy link
Contributor

Example -- nautobot core ruff settings:

[tool.ruff.lint]
select = [
    "DJ",  # flake8-django
    "E",  # pycodestyle
    "F",  # pyflakes
    "I",  # isort
    "PIE",  # flake8-pie
    "RUF",  # ruff itself
    "S",  # flake8-bandit
    "W",  # pycodestyle
]
ignore = [
    "E501",  # pycodestyle: line-too-long
    "PIE808",  # unnecessary-range-start
    "RUF012",  # mutable-class-default - see https://github.com/astral-sh/ruff/issues/5243
]

[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-local-folder = ["example_app"]
order-by-type = false

Cookie ruff settings:

[tool.ruff.lint]
select = [
    "D",  # pydocstyle
    "F", "E", "W",  # flake8
    "PL",  # pylint
    "S",  # bandit
    "I",  # isort
]
ignore = [
    # warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible.
    "D203",  # 1 blank line required before class docstring

    # D212 is enabled by default in google convention, and complains if we have a docstring like:
    # """
    # My docstring is on the line after the opening quotes instead of on the same line as them.
    # """
    # We've discussed and concluded that we consider this to be a valid style choice.
    "D212",  # Multi-line docstring summary should start at the first line
    "D213",  # Multi-line docstring summary should start at the second line

    # Produces a lot of issues in the current codebase.
    "D401",  # First line of docstring should be in imperative mood
    "D407",  # Missing dashed underline after section
    "D416",  # Section name ends in colon
    "E501",  # Line too long
]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.per-file-ignores]
"{{ cookiecutter.app_name }}/migrations/*" = [
    "D",
]
"{{ cookiecutter.app_name }}/tests/*" = [
    "D",
    "S"
]
@glennmatthews
Copy link
Contributor

Perhaps the example_app ruff settings in core are also relevant - https://github.com/nautobot/nautobot/blob/develop/examples/example_app/pyproject.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants