pylint icon indicating copy to clipboard operation
pylint copied to clipboard

output-format=pylint_gitlab.GitlabCodeClimateReporter not working since 2.15.x

Open nifx opened this issue 2 years ago • 2 comments

Bug description

As a starting point, I work with the following package versions:

pylint==2.14.5
pylint-gitlab==1.1.0 (which is latest released version)

I generated a dummy.py with the following content:

#dummy file
a=1
b=2
print(f'{a+b}')

Then, I start pylint:

# pylint --enable=all dummy.py
************* Module dummy
dummy.py:1:0: C0114: Missing module docstring (missing-module-docstring)
dummy.py:2:0: C0103: Constant name "a" doesn't conform to UPPER_CASE naming style (invalid-name)
dummy.py:3:0: C0103: Constant name "b" doesn't conform to UPPER_CASE naming style (invalid-name)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Here, the output is totally fine. Afterwards, I change the output format:

# pylint --enable=all --output-format=pylint_gitlab.GitlabCodeClimateReporter dummy.py                            
[                                                                                                                 
    {                                                                                                             
        "description": "C0114: Missing module docstring",                                                         
        "severity": "minor",                                                                                      
        "location": {                                                                                             
            "path": "dummy.py",                                                                                   
            "lines": {                                                                                            
                "begin": 1                                                                                        
            }                                                                                                     
        },                                                                                                        
        "fingerprint": "6b0e1f3bb6dbc6587e6b3990434e802e20347aaebdc9fc620b109909347740aa"                         
    },                                                                                                            
    {                                                                                                             
        "description": "C0103: Constant name \"a\" doesn't conform to UPPER_CASE naming style",                   
        "severity": "minor",                                                                                      
        "location": {                                                                                             
            "path": "dummy.py",                                                                                   
            "lines": {                                                                                            
                "begin": 2                                                                                        
            }                                                                                                     
        },                                                                                                        
        "fingerprint": "4ecc5c181e09a140e20a63b51de3bcd08973ab14b71f1d497ea009d04c28a09b"                         
    },                                                                                                            
    {                                                                                                             
        "description": "C0103: Constant name \"b\" doesn't conform to UPPER_CASE naming style",                   
        "severity": "minor",                                                                                      
        "location": {                                                                                             
            "path": "dummy.py",                                                                                   
            "lines": {                                                                                            
                "begin": 3                                                                                        
            }                                                                                                     
        },                                                                                                        
        "fingerprint": "1756a51a2ac3e73821678ecdefdc35d7dcbaa54f64d9b2eaf227154f0e640da7"                         
    }                                                                                                             
]                                                                                                                 

Again, the output is totally fine. When I update pylint to 2.15.x (e.g. 2.15.3), I observe the following:

  • output of my example with default output format is still the same -> working -> no issue
  • output of my example using pylint_gitlab.GitlabCodeClimateReporter output format -> does not generate any output -> ISSUE

In case of the described issue, there is absolutely no console output. I checked the returned error level, which is 16 in all cases and seems to be fine.

# pylint --enable=all --output-format=pylint_gitlab.GitlabCodeClimateReporter dummy.py           
                                                                                                 
# echo %errorlevel%                                                                              
16                                                                                               

Configuration

No response

Command used

see above

Pylint output

see above

Expected behavior

Console output shall be generated

Pylint version

pylint==2.14.5 for the working example
pylint==2.15.3 to reproduce the issue

OS / Environment

Windows 10 64 bit python 3.7 (but I can reproduce it also in Linux docker with python 3.7 / 3.8 / 3.9)

Additional dependencies

No response

nifx avatar Sep 22 '22 05:09 nifx

Thank you for opening the issue. It look like an issue in the plugin, could you also open an issue in pylint-gitlab, please ?

Pierre-Sassoulas avatar Sep 22 '22 05:09 Pierre-Sassoulas

Thanks for the fast feedback: I opened an issue at pylint-gitlab -> https://gitlab.com/smueller18/pylint-gitlab/-/issues/17

nifx avatar Sep 22 '22 05:09 nifx

Fixed with pylint-gitlab 1.2.0

nifx avatar Dec 06 '22 05:12 nifx