Skip to content

Commit b5129d7

Browse files
authored
fix: pylint should run on compiled code (#244)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 43a7fb4 commit b5129d7

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

docs/pages/guides/style.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,9 @@ And a noxfile entry:
765765
```python
766766
@nox.session
767767
def pylint(session: nox.Session) -> None:
768-
session.install("-e", ".")
768+
session.install("-e.")
769769
session.install("pylint")
770-
session.run("pylint", "src", *session.posargs)
770+
session.run("pylint", "<your package>", *session.posargs)
771771
```
772772

773773
And you can add this to your GitHub Actions using `run: pipx run nox -s pylint`.

{{cookiecutter.project_name}}/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def pylint(session: nox.Session) -> None:
3535
# This needs to be installed into the package environment, and is slower
3636
# than a pre-commit check
3737
session.install(".", "pylint")
38-
session.run("pylint", "src", *session.posargs)
38+
session.run("pylint", "{{ cookiecutter.__project_slug }}", *session.posargs)
3939

4040

4141
@nox.session

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,10 @@ isort.required-imports = ["from __future__ import annotations"]
326326

327327
[tool.pylint]
328328
py-version = "3.8"
329-
ignore-paths= ["src/{{ cookiecutter.__project_slug }}/_version.py"]
329+
ignore-paths = [".*/_version.py"]
330+
{%- if cookiecutter.__type == "compiled" %}
331+
extension-pkg-allow-list = ["{{ cookiecutter.__project_slug }}._core"]
332+
{%- endif %}
330333
reports.output-format = "colorized"
331334
similarities.ignore-imports = "yes"
332335
messages_control.disable = [

{{cookiecutter.project_name}}/{% if cookiecutter.__ci=='gitlab' %}.gitlab-ci.yml{% endif %}

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ tests:
8181
matrix:
8282
- IMAGE: ['python:3.8-buster', 'python:3.11-buster']
8383

84-
{%- if not cookiecutter.__compiled %}
84+
{%- if cookiecutter.__type == "pure" %}
8585
package:
8686
stage: build
8787
rules:
@@ -141,7 +141,7 @@ make_wheels:
141141
.deploy:
142142
stage: deploy
143143
dependencies:
144-
{%- if not cookiecutter.__compiled %}
144+
{%- if cookiecutter.__type == "pure" %}
145145
- package
146146
{%- else %}
147147
- make_sdist

0 commit comments

Comments
 (0)