-
Notifications
You must be signed in to change notification settings - Fork 1
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
Include an option to use ruff as the linter #188
Conversation
marcospri
commented
Nov 12, 2024
•
edited
Loading
edited
- Applied on LMS: Apply changes from the cookiecutter lms#6929
- Also applied to via over: Apply changes from cookiecutter: Migrate from pylint to ruff via#1498
1c30ee0
to
e3dc1f5
Compare
2e819db
to
d2dcc6b
Compare
9373e25
to
f9d53a7
Compare
@@ -43,6 +43,10 @@ def remove_conditional_files(): | |||
paths_to_remove.extend([".github/workflows/pypi.yml"]) | |||
{% endif %} | |||
|
|||
{% if cookiecutter.get("linter") == "ruff" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff config is more compact, no need for two files, remove the test one in case is generated.
_shared/project/pyproject.toml
Outdated
@@ -77,7 +159,12 @@ show_missing = true | |||
precision = 2 | |||
fail_under = 100.00 | |||
skip_covered = true | |||
exclude_also = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this type of conditional from coverage.
@@ -48,7 +52,13 @@ def delete(engine: Engine) -> None: | |||
else: | |||
pre_delete(engine) | |||
|
|||
Base.metadata.drop_all(engine) | |||
with engine.connect() as connection: | |||
# Delete the DB "public" schema directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of LMS, it seems to have worked for a while. Bringing it to other repos.
"PLR2004", # Magic values, we mostly get it on HTTP status codes | ||
|
||
# Disabled during the pylint migration, ideally we'll enable this after we are settled in ruff | ||
"RET504", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having these here allows to remove them from the template and apply to all projects.
Rebased |
This is extracted from #188 as a separate PR. This commit also adds includes for per-project overriding or extending of the coverage excludes: * If a project has a `.cookiecutter/includes/coverage/exclude_also` file that will _replace_ the cookiecutter's default `exclude_also`'s * If a project has a `.cookiecutter/includes/coverage/exclude_also/tail` file that will _extend_ the cookiecutter's default `exclude_also`'s Also fix a bug in `local_extensions.py`'s `include_exists(path)` function: don't crash if there's a _folder_ (rather than a file) at `path` (the code was catching the wrong exception class, looks like just a mistake).
Extracted from #188 as a separate PR. > Type-checks the interior of functions without type annotations. https://mypy.readthedocs.io/en/stable/config_file.html#confval-check_untyped_defs
Add a couple of includes for per-project customisation of which modules we tell mypy to ignore. This also tidies up the formatting of this section of pyproject.toml a little, which unfortunately will mean a change to every single project. This is extracted from #188 as a separate PR.
Add a couple of includes for per-project customisation of which modules we tell mypy to ignore. This also tidies up the formatting of this section of pyproject.toml a little, which unfortunately will mean a change to every single project. This is extracted from #188 as a separate PR.
Extracted from #188 as a separate PR.
This is extracted from #188 as a separate PR. This commit also adds includes for per-project overriding or extending of the coverage excludes: * If a project has a `.cookiecutter/includes/coverage/exclude_also` file that will _replace_ the cookiecutter's default `exclude_also`'s * If a project has a `.cookiecutter/includes/coverage/exclude_also/tail` file that will _extend_ the cookiecutter's default `exclude_also`'s Also fix a bug in `local_extensions.py`'s `include_exists(path)` function: don't crash if there's a _folder_ (rather than a file) at `path` (the code was catching the wrong exception class, looks like just a mistake).
This is extracted from #188 as a separate PR. This commit also adds includes for per-project overriding or extending of the coverage excludes: * If a project has a `.cookiecutter/includes/coverage/exclude_also` file that will _replace_ the cookiecutter's default `exclude_also`'s * If a project has a `.cookiecutter/includes/coverage/exclude_also/tail` file that will _extend_ the cookiecutter's default `exclude_also`'s Also fix a bug in `local_extensions.py`'s `include_exists(path)` function: don't crash if there's a _folder_ (rather than a file) at `path` (the code was catching the wrong exception class, looks like just a mistake).
Add a couple of includes for per-project customisation of which modules we tell mypy to ignore. This also tidies up the formatting of this section of pyproject.toml a little, which unfortunately will mean a change to every single project. This is extracted from #188 as a separate PR.
Add a couple of includes for per-project customisation of which modules we tell mypy to ignore. This also tidies up the formatting of this section of pyproject.toml a little, which unfortunately will mean a change to every single project. This is extracted from #188 as a separate PR.
Extracted from #188 as a separate PR.
43f91b1
to
8f2f97d
Compare
I've rebased this onto #201 |
Closing in favour of #196 |