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.

[Code health] checkstyle reports indentation error when using @Rule annotation

See original GitHub issue

Consider the following code:

  public @Rule(order = 0)
  HiltAndroidRule hiltRule = new HiltAndroidRule(this);

Running checkstyle on this returns an error:

'HiltAndroidRule' has incorrect indentation level 2, expected level should be 6. [Indentation]

This is not correct, since the indentation of both lines is correct (2 spaces).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gino-mcommented, Aug 26, 2020

Wouldn’t we generally put the visibility modifiers (public) after the annotations?

0reactions
gino-mcommented, Nov 17, 2020

#569 merged so closing. Please reopen if necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checkstyle issuing an indentation warning on an annotation?
When I run my project through Checkstyle, I get an error stating "assign child at indentation level 2 not at correct indentation, 4"....
Read more >
Checks - checkstyle
Checks location of annotation on language elements. AnnotationOnSameLine, Checks that annotations are located on the same line with their targets.
Read more >
Javadoc Comments - checkstyle
As workaround, you need to specify both types in javadoc (parent and exact type). Javadoc is not required on a method that is...
Read more >
Google Java Style Guide - Checkstyle
1 Introduction. This document serves as the complete definition of Google's coding standards for source code in the Java™ Programming Language.
Read more >
checkstyle – Old Release Notes - SourceForge
Author: Roman Ivanov; Java Grammar: need to introduce "id" rule to solve ... Author: Shashwat Jaiswal #7834; Pitest Issue: Indentation.
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