-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 score option for JSON export #3514
Fix score option for JSON export #3514
Conversation
1119f87
to
94442df
Compare
pylint/reporters/json_reporter.py
Outdated
"""Don't do anything in this reporter.""" | ||
output = io.StringIO() | ||
TextWriter().format(layout, output) | ||
score = output.getvalue().split("\n")[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a better way, but understanding the way the VNode works and how one can finally get the message encapsulated in ten layers of linked list and visitor pattern does not seem worth it.
94442df
to
c302d8b
Compare
Uf, this is tough. I don't think we should fix it as the JSON integration is most likely at the basis of multiple CI tools for consuming and displaying pylint results (e.g. tools like Codacy or custom Jenkins integrations come to mind). Seems like a good candidate for a potential 3.0 release though, but for now we should keep it as is. |
7672eef
to
5ffb166
Compare
5ffb166
to
2a41113
Compare
2a41113
to
774e861
Compare
774e861
to
f6b5a72
Compare
This is a fix but I wonder... This looks like the fabled bug that will break countless integration by being fixed. `--score=y` is the default setting, and json is probably a prime candidate for automation. Is it reasonable to fix it and ask everyone to change their option to `-s n`? I'm pretty sure no one read the pylint's changelog unless we break their build.
f6b5a72
to
46b050d
Compare
This looks very unhandy to consume programmatically: [
{
"type": "convention",
"module": "fib",
"obj": "",
"line": 1,
"column": 0,
"path": "fib.py",
"symbol": "missing-module-docstring",
"message": "Missing module docstring",
"message-id": "C0114"
},
{
"score": "Your code has been rated at 3.33/10"
}
] Wouldn't something like this be better? {
"score": 0.333,
"violations": [
{
"type": "convention",
"module": "fib",
"obj": "",
"line": 1,
"column": 0,
"path": "fib.py",
"symbol": "missing-module-docstring",
"message": "Missing module docstring",
"message-id": "C0114"
}
]
} |
You're right. And as 3.0 is an alpha version, everything can change right now :) Could you open an issue for this, please ? |
Sure 👍 |
Steps
doc/whatsnew/<current release.rst>
.Description
This fix #3504, but I wonder... It looks like the fabled bug that will break countless integration by being fixed.
--score=y
is the default setting, and JSON is probably a prime candidate for automation. Is it reasonable to fix it and ask everyone to change their option to-s n
? I'm pretty sure no one read the pylint's changelog and even if they do we can't know how many poeple have a working continuous integration that iwll be broken by this.Type of Changes
Related Issue
Closes #3504