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

Return code 28 on irrelevant pyproject.toml #9444

Closed
buhtz opened this issue Feb 17, 2024 · 3 comments
Closed

Return code 28 on irrelevant pyproject.toml #9444

buhtz opened this issue Feb 17, 2024 · 3 comments
Labels
Invalid Not a bug, already exists or already fixed

Comments

@buhtz
Copy link

buhtz commented Feb 17, 2024

Bug description

I am not sure but to my knowledge the return code 28 on GNU Linux indicates that something is wrong with the config file.

The point is I don't use pylint via config file. I do feed all configuration via shell switches.
The project itself do has a pyproject.toml file but there is no section (table?) for pylint in it.

Configuration

Not a config file but a unitest


    def test030_pylint(self):
        """Use Pylint to check for specific error codes.

        Some facts about PyLint
         - It is one of the slowest available linters.
         - It is able to catch lints none of the other linters
        """

        # Pylint base command
        cmd = [
            'pylint',
            # Storing results in a pickle file is unnecessary
            '--persistent=n',
            # autodetec number of parallel jobs
            '--jobs=0',
            # Disable scoring  ("Your code has been rated at xx/10")
            '--score=n',
            # PEP8 conform line length (see PyLint Issue #3078)
            f'--max-line-length={PEP8_MAX_LINE_LENGTH}',
            # prevent false-positive no-module-member errors
            '--extension-pkg-whitelist=lxml',
            # List of members which are set dynamically and missed by pylint
            # inference system, and so shouldn't trigger E1101 when accessed.
            '--generated-members=WD_ALIGN_PARAGRAPH,WD_ORIENT,PARAGRAPH',
            # Allowlist variable names
            '--good-names=idx,fp,df',
            # Allow fstrings when logging
            '--disable=logging-fstring-interpolation',
        ]
        # Add py files
        cmd.extend(self.collected_py_files[6:7])

        # subprocess.run(cmd, check=True)
        r = subprocess.run(
            cmd,
            check=False,
            universal_newlines=True,
            capture_output=True)

        print(f'!!!!!!!!!!!!!!!! {r.stdout=}')
        print(f'!!!!!!!!!!!!1!! {r.stderr=}')
        print(f'ÖÖÖÖÖÖÖÖÖÖÖÖÖÖ {r.returncode=}')

        self.assertEqual(0, r.returncode)

Command used

See configuration

Pylint output

Returncode 28

Expected behavior

PyLint should ignore the config file pyproject.toml when it does not contain a section/table related to pylint.

Pylint version

pylint 3.0.3                                                                                                                  astroid 3.0.2                                                                                                                 Python 3.9.2 (default, Feb 28 2021, 17:03:44)                                                                                 [GCC 10.2.1 20210110]

OS / Environment

Debian GNU Linux 12

@buhtz buhtz added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Feb 17, 2024
@jacobtylerwalls
Copy link
Member

Hi @buhtz 👋

Actually, the answer just above the one you linked explains pylint's exit codes accurately. Docs here. Nothing to do with a config file.

@jacobtylerwalls jacobtylerwalls closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2024
@jacobtylerwalls jacobtylerwalls added Invalid Not a bug, already exists or already fixed and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Feb 17, 2024
@buhtz
Copy link
Author

buhtz commented Feb 17, 2024

Maybe consider to a human readable return code system?

@Pierre-Sassoulas
Copy link
Member

Feel free to make a proposal if you have something in mind, For me exit codes are numerical by nature and there's nothing we can do to make them clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Invalid Not a bug, already exists or already fixed
Projects
None yet
Development

No branches or pull requests

3 participants