Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Change pylint invocation to avoid namespace clashes #382

Closed
@c24t

Description

@c24t

See #376 (comment).

Right now eachdist.py generates a long pylint command that lints the entire project in one run, which raises false errors (especially no-member errors) if two modules import different classes or modules with the same local name.

It's easy to fix this by linting each file separately, which eachdist.py already supports:

diff --git a/scripts/eachdist.py b/scripts/eachdist.py
index 8d41315f..c23e8853 100755
--- a/scripts/eachdist.py
+++ b/scripts/eachdist.py
@@ -478,9 +478,7 @@ def lint_args(args):
     )
     runsubprocess(args.dry_run, ("flake8", rootdir), check=True)
     execute_args(
-        parse_subargs(
-            args, ("exec", "pylint {}", "--all", "--mode", "lintroots",),
-        )
+        parse_subargs(args, ("exec", "pylint {}", "--mode", "lintroots",),)
     )

But this makes lint significantly slower. A better solution might be to lint each package separately, or lint all files separately in parallel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogbuild & infraIssues related to build & infrastructure.release:after-gaTo be resolved after GA release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions