Closed mzbroch closed 1 month ago
This is due to not pinning a specific version of ruff
in the cookiecutter - presumably a newly baked cookie is pulling in a newer version of ruff than the one that the cookiecutter was tested against.
We should pin ruff
with this work.
I don't think we're going to be able to make this perfect because of variability in the project name length causing issues like this:
diff --git a/tasks.py b/tasks.py
index add0c7f..3068dc7 100644
--- a/tasks.py
+++ b/tasks.py
@@ -661,7 +661,9 @@ def hadolint(context):
@task
def pylint(context):
"""Run pylint code analysis."""
- command = 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml nautobot_ssot_system_of_record'
+ command = (
+ 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml nautobot_ssot_system_of_record'
+ )
run_command(context, command)
diff --git a/tasks.py b/tasks.py
index ad30929..f41ea1e 100644
--- a/tasks.py
+++ b/tasks.py
@@ -661,9 +661,7 @@ def hadolint(context):
@task
def pylint(context):
"""Run pylint code analysis."""
- command = (
- 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml nautobot_chatops_my_app'
- )
+ command = 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml nautobot_chatops_my_app'
run_command(context, command)
I'll update the docs to add ruff to the quick start steps
@glennmatthews do you think it's worth the technical debt to pin ruff in the cookie cutter? I do remember that at some point there was a change in ruff's behavior for line breaks but I can't remember if that was a change in ruff's behavior or if it was something we changed in core's config. I think the root cause of this issue is fixed by fixing the docs and the invoke autoformat
/invoke ruff
commands.
My personal preference would be to pin the versions of all the dev dependencies (at least to a major version, for those using semver) for reproducible results, and use renovate to keep the cookie up-to-date and driftmanager to push the updates to the apps as appropriate.
My personal preference would be to pin the versions of all the dev dependencies (at least to a major version, for those using semver) for reproducible results, and use renovate to keep the cookie up-to-date and driftmanager to push the updates to the apps as appropriate.
It looks like ruff doesn't use semantic versioning so our only option here may be to hard pin it.
Environment
Observed Behavior
For the newly rendered cookie tests on GitHub are failing :
Expected Behavior
I can render cookie and it passes all GH tests
Steps to Reproduce