question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warnings are not reported at the correct line number

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
arturboschcommented, Nov 2, 2017

@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.

0reactions
lock[bot]commented, Jun 19, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found