feat!: add location to error reports#357
Merged
mkniewallner merged 6 commits intofpgmaas:mainfrom May 7, 2023
Merged
Conversation
eef1d99 to
a420116
Compare
Codecov Report
@@ Coverage Diff @@
## main #357 +/- ##
=====================================
Coverage 96.8% 96.8%
=====================================
Files 36 37 +1
Lines 1003 1029 +26
Branches 207 206 -1
=====================================
+ Hits 971 997 +26
Misses 20 20
Partials 12 12
|
61cf744 to
e5476aa
Compare
fpgmaas
approved these changes
May 7, 2023
1cee383 to
90b5801
Compare
4 tasks
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #349.
PR Checklist
docsis updatedDescription of changes
Add error locations in both text and JSON error reports. In order to display those changes, this PR reworks both outputs, so they end up being closer to what
flake8orruffhave.Text output
Before:
After:
JSON output
Before:
{ "obsolete": [ "chardet" ], "missing": [ "an_import", "another_import" ], "transitive": [ "cfgv" ], "misplaced_dev": [] }After:
[ { "error": { "code": "DEP001", "message": "an_import imported but missing from the dependency definitions" }, "module": "an_import", "location": { "file": "deptry/dependency_getter/base.py", "line": 9, "column": 4 } }, { "error": { "code": "DEP001", "message": "another_import imported but missing from the dependency definitions" }, "module": "another_import", "location": { "file": "deptry/dependency_getter/base.py", "line": 10, "column": 4 } }, { "error": { "code": "DEP003", "message": "cfgv imported but it is a transitive dependency" }, "module": "cfgv", "location": { "file": "deptry/dependency_getter/base.py", "line": 11, "column": 4 } }, { "error": { "code": "DEP001", "message": "an_import imported but missing from the dependency definitions" }, "module": "an_import", "location": { "file": "deptry/dependency_getter/pdm.py", "line": 12, "column": 4 } }, { "error": { "code": "DEP002", "message": "chardet defined as a dependency but not used in the codebase" }, "module": "chardet", "location": { "file": "pyproject.toml", "line": null, "column": null } } ]