Open sobolevn opened 5 years ago
Here are the specs: https://github.com/codeclimate/spec
Related #638
As WPS is a flake8
plugin this project here (https://pypi.org/project/flake8-codeclimate/) doesn't solve this issue?
Looks like it does!
@thepabloaguilar do you ming creating a PR to add this to our docs?
Nop, I'll open ASAP
Ok, I've checked and it'lll not work for this case! It just handles the basic cases, also it seems a bit unmaintained. This scared me:
def error_category(error):
try:
return error_classes[error.code]["category"]
except KeyError:
try:
return error_classes[error.code][:2]["category"]
except KeyError:
try:
return error_classes[error.code][:1]["category"]
except KeyError:
return category_bug
I saw your discussion https://github.com/bennylope/flake8-codeclimate/issues/5 about extending, but I think isn't possible to do that! With that in mind let's use WPS formatter and adding an option like --wemake-codeclimate
to be provided by the user, so we change the formatter based on that option! WDYT?
Also, I can try to create a separated plugin by my own to handle all the projects code (that's can be easy if every project will have a file with all the codes and its severity)!
Also, I can try to create a separated plugin by my own to handle all the projects code (that's can be easy if every project will have a file with all the codes and its severity)!
This might be really useful!
I've started with WPS, I scraped its documentation and exported a JSON file. My idea is to build an "index" with all the codes, many scrapers one for each plugin! I think it's worth since people doesn't change the documentation structure a lot (maybe never).
If you want to see the initial format:
[
{"error_code": "WPS300", "error_name": "LocalFolderImportViolation", "description": "Found local folder import"},
{"error_code": "WPS301", "error_name": "DottedRawImportViolation", "description": "Found dotted raw import: {0}"},
{"error_code": "WPS302", "error_name": "UnicodeStringViolation", "description": "Found unicode string prefix: {0}"},
{"error_code": "WPS303", "error_name": "UnderscoredNumberViolation", "description": "Found underscored number: {0}"},
{"error_code": "WPS304", "error_name": "PartialFloatViolation", "description": "Found partial float: {0}"},
{"error_code": "WPS305", "error_name": "FormattedStringViolation", "description": "Found `f` string"},
{"error_code": "WPS100", "error_name": "WrongModuleNameViolation", "description": "Found wrong module name"},
{"error_code": "WPS101", "error_name": "WrongModuleMagicNameViolation", "description": "Found wrong module magic name"}
...
]
Btw, WPS has 234 checks!
This might help you as well https://flake8.codes/
There is also this package: https://github.com/awelzel/flake8-gl-codeclimate
(the GitLab code quality report is a subset of the code climate spec)
https://codeclimate.com/blog/build-your-own-codeclimate-engine/
Then we can fill their form to suggest the engine: https://codeclimate.com/dev_form/