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

add pylint configuration #371

Merged
merged 7 commits into from
Oct 19, 2023
Merged

add pylint configuration #371

merged 7 commits into from
Oct 19, 2023

Conversation

Artturin
Copy link
Collaborator

but not tests yet

@Artturin Artturin force-pushed the improveconfigs branch 2 times, most recently from 1b14e34 to bc9f5ad Compare October 19, 2023 06:31
but not tests yet
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/e08e100b0c6a6651c3235d1520c53280142d9d5f' (2023-08-05)
  → 'github:NixOS/nixpkgs/12bdeb01ff9e2d3917e6a44037ed7df6e6c3df9d' (2023-10-15)
move the strict enablement to the pyproject.toml so disabling checks
works correctly because `--strict` takes precedence over the file

Checking everything was disabled in 60205b9 due to (seemingly) a bug
remove redundant enables
```
--strict Strict mode; enables the following flags: --warn-unused-configs, --disallow-any-generics, --disallow-
           subclassing-any, --disallow-untyped-calls, --disallow-untyped-defs, --disallow-incomplete-defs, --check-
           untyped-defs, --disallow-untyped-decorators, --warn-redundant-casts, --warn-unused-ignores, --warn-return-any,
           --no-implicit-reexport, --strict-equality, --strict-concatenate
```
@Artturin Artturin marked this pull request as ready for review October 19, 2023 07:58
@Artturin
Copy link
Collaborator Author

Artturin commented Oct 19, 2023

Will fix more lints in a separate PR

@figsoda
Copy link
Collaborator

figsoda commented Oct 19, 2023

Ruff seems to support some pylint lints under PL, since we are already using ruff, can we use ruff instead? Adding "PL" to tools.ruff.select might be sufficient

@@ -297,7 +297,7 @@ def nix_build(
def write_shell_expression(
filename: Path, attrs: list[str], system: str, nixpkgs_config: Path
) -> None:
with open(filename, "w+") as f:
with open(filename, "w+", encoding="utf-8") as f:
Copy link
Owner

Choose a reason for hiding this comment

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

What happens if you don't specify encoding?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://pylint.pycqa.org/en/latest/user_guide/messages/warning/unspecified-encoding.html

It is better to specify an encoding when opening documents. Using the system default implicitly can create problems on other operating systems. See https://peps.python.org/pep-0597/

@Mic92
Copy link
Owner

Mic92 commented Oct 19, 2023

@Mic92
Copy link
Owner

Mic92 commented Oct 19, 2023

I guess it doesn't hurt.. checking should be still fast enough

@Mic92
Copy link
Owner

Mic92 commented Oct 19, 2023

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Oct 19, 2023

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at c20b63f

@mergify mergify bot merged commit c20b63f into Mic92:master Oct 19, 2023
4 checks passed
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