Warnings are not reported at the correct line number
See original GitHub issueI’m using this version of detekt: “1.0.0.M12.1” The number of warnings reported are correct but the sometimes the line number where the rule is broken is not accurate.
I created a new project with only the following class as example: https://gist.github.com/davidgyavol/bcd9bfdec7eb2af06fadac7718bf8a25 MaxLineLength is set to 100. The following lines should break the rule: 180,181 but after i run detektCheck I get the following warnings related to the MaxLineLength check:
<error line="176" column="9" severity="warning" message="(MaxLineLength)" source="detekt.MaxLineLength" />
<error line="180" column="55" severity="warning" message="(MaxLineLength)" source="detekt.MaxLineLength" />
This reproduces with other checks too (EmptyClassBlock should be at line 80)
<file name="com/example/gyavoldavid/myapplication/Main.kt">
<error line="66" column="1" severity="info" message="(EmptyClassBlock)" source="detekt.EmptyClassBlock" />
<error line="3" column="1" severity="warning" message="(WildcardImport)" source="detekt.WildcardImport" />
<error line="176" column="9" severity="warning" message="(MaxLineLength)" source="detekt.MaxLineLength" />
<error line="180" column="55" severity="warning" message="(MaxLineLength)" source="detekt.MaxLineLength" />
</file>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top Results From Across the Web
would be nice to get absolute line numbers in warnings #6036
At the moment when I get a warning on docstring line 57 I first have to manually find the associated docstring in my...
Read more >How to get the line number of a warning that made by pandas
The warnings module uses linecache to look up the source code line when msg. line is missing. if msg. line is None: try:...
Read more >An equivalent of -file-line-error for warnings - TeX
Here is an actual excerpt from my .log file. Note that there are many open and close parenthesis in it which are not...
Read more >Warning Options (Using the GNU Compiler Collection (GCC))
Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky or suggest there may have been an...
Read more >Form 50058 Submission FAQs - IMS/PIC - HUD
A "warning" error does not stop the processing of the submission for that household ... The program code should be entered in line...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jbaginski fixed this for MaxLineLength. It is on track. Had no other complainings about line and column mismatches but this is an important thing if we want to build other tools around detekt’s reports.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.