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

Replace black, flake8, pydocstyle, bandit with ruff #314

Closed
wants to merge 27 commits into from

Conversation

jdrew82
Copy link
Contributor

@jdrew82 jdrew82 commented Jan 4, 2024

This PR is to update the project linters to replace black, flake8, pydocstyle, and bandit with ruff. This speeds up tests significantly.

nautobot_ssot/integrations/aci/signals.py Outdated Show resolved Hide resolved
nautobot_ssot/integrations/device42/utils/nautobot.py Outdated Show resolved Hide resolved
nautobot_ssot/templatetags/render_diff.py Outdated Show resolved Hide resolved
nautobot_ssot/templatetags/render_diff.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
tasks.py Outdated Show resolved Hide resolved
…ings to pyproject.toml.

Also addressed all the complaints that were raised.
@itdependsnetworks
Copy link
Contributor

FYI: bandit in ruff is still missing 3 checks, 2 of which are django ones, additionally a bunch have been added recently, so not sure if they have been released.

@@ -41,6 +41,8 @@ def _move_data(apps, schema_editor):


class Migration(migrations.Migration):
"""Migration class."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be needed, we should update the configuration for pydocstyle's ruff equivalant to not need doc strings.

@glennmatthews
Copy link
Contributor

FYI: bandit in ruff is still missing 3 checks, 2 of which are django ones, additionally a bunch have been added recently, so not sure if they have been released.

Any chance you have a link with details about this?

@itdependsnetworks
Copy link
Contributor

FYI: bandit in ruff is still missing 3 checks, 2 of which are django ones, additionally a bunch have been added recently, so not sure if they have been released.

Any chance you have a link with details about this?

astral-sh/ruff#1646 and the faq has been very helpful in knowing what is ready vs not as well as the links.

@glennmatthews
Copy link
Contributor

Thanks. It's not clear to me how the "missing" B703 mark_safe check is different from the "present" S308 mark_safe check - any insight? I agree that it would be good to get B610 included.

@itdependsnetworks
Copy link
Contributor

@jdrew82
Copy link
Contributor Author

jdrew82 commented Jan 31, 2024

Closing for now until we figure out how we want to proceed with ruff.

@jdrew82 jdrew82 closed this Jan 31, 2024
@jdrew82 jdrew82 deleted the feat-use_ruff branch April 23, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants