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

Wrong json output format #21

Open
mathieugouin opened this issue Nov 12, 2024 · 2 comments
Open

Wrong json output format #21

mathieugouin opened this issue Nov 12, 2024 · 2 comments

Comments

@mathieugouin
Copy link

Hello, thanks for this great addon!

I have seen a json report being generated as:

[
    {"type": "issue", "check_name": "unknown", "description": "camelcase 'xml.etree.ElementTree' imported as acronym 'ET' [N817]", "categories": ["Bug Risk"], "location": {"path": ".\\parsing.py", "lines": {"begin": 3, "end": 3}}, "fingerprint": "099bd931a790b68fc57194c5c1317675236110a9", "severity": "minor"},
    {"type": "issue", "check_name": "mccabe", "description": "'plot_schedule' is too complex (11) [C901]", "categories": ["Complexity"], "location": {"path": ".\\plot.py", "lines": {"begin": 128, "end": 128}}, "fingerprint": "7e22d50c6c523762291546de15d31129c29e7788", "severity": "minor"},
    {"type": "issue", "check_name": "pycodestyle", "description": "the backslash is redundant between brackets [E502]", "categories": ["Style"], "location": {"path": ".\\schedule_generator.py", "lines": {"begin": 120, "end": 120}}, "fingerprint": "e636c594a4485ded7f11ee33ced9131d2a25d262", "severity": "major"},
    {"type": "issue", "check_name": "pycodestyle", "description": "the backslash is redundant between brackets [E502]", "categories": ["Style"], "location": {"path": ".\\validation.py", "lines": {"begin": 18, "end": 18}}, "fingerprint": "937b28b08d5b2f77b5596167dbca83d937d8ba12", "severity": "major"}1     C901 'plot_schedule' is too complex (11)
2     E502 the backslash is redundant between brackets
1     N817 camelcase 'xml.etree.ElementTree' imported as acronym 'ET'

]

The command I use in my gitlab pipeline is:

python -m pip install --upgrade flake8 flake8-gl-codeclimate
python -m flake8 . --select=E9,F63,F7,F82
python -m flake8 . --exit-zero --format=gl-codeclimate --output-file=flake8-report.json

If it can influence, I have a .flake8 file as:

# Ref: https://flake8.pycqa.org/en/latest/user/configuration.html
#      https://flake8.pycqa.org/en/latest/user/options.html
[flake8]

max-complexity = 10
max-line-length = 120

exclude =
    .git
    example
    .ipynb_checkpoints
    .pytest_cache

statistics = True
count = True
show-source = True
@mathieugouin
Copy link
Author

It turns out by removing:

statistics = True
count = True
show-source = True

in my .flake8, the report is now OK. Not sure which one caused it, but I'm ok without these settings. They were mostly useful for plain text output.

@mathieugouin
Copy link
Author

I'll keep the issue open in case you want to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant