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

fix: pylint should run on compiled code #244

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/pages/guides/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,9 @@ And a noxfile entry:
```python
@nox.session
def pylint(session: nox.Session) -> None:
session.install("-e", ".")
session.install("-e.")
session.install("pylint")
session.run("pylint", "src", *session.posargs)
session.run("pylint", "<your package>", *session.posargs)
```

And you can add this to your GitHub Actions using `run: pipx run nox -s pylint`.
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def pylint(session: nox.Session) -> None:
# This needs to be installed into the package environment, and is slower
# than a pre-commit check
session.install(".", "pylint")
session.run("pylint", "src", *session.posargs)
session.run("pylint", "{{ cookiecutter.__project_slug }}", *session.posargs)


@nox.session
Expand Down
5 changes: 4 additions & 1 deletion {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ isort.required-imports = ["from __future__ import annotations"]

[tool.pylint]
py-version = "3.8"
ignore-paths= ["src/{{ cookiecutter.__project_slug }}/_version.py"]
ignore-paths = [".*/_version.py"]
{%- if cookiecutter.__type == "compiled" %}
extension-pkg-allow-list = ["{{ cookiecutter.__project_slug }}._core"]
{%- endif %}
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ tests:
matrix:
- IMAGE: ['python:3.8-buster', 'python:3.11-buster']

{%- if not cookiecutter.__compiled %}
{%- if cookiecutter.__type == "pure" %}
package:
stage: build
rules:
Expand Down Expand Up @@ -141,7 +141,7 @@ make_wheels:
.deploy:
stage: deploy
dependencies:
{%- if not cookiecutter.__compiled %}
{%- if cookiecutter.__type == "pure" %}
- package
{%- else %}
- make_sdist
Expand Down
Loading