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

Ignore .idea directory in spotless checks #4657

Merged
merged 3 commits into from
Nov 14, 2022

Conversation

daniellehrner
Copy link
Contributor

@daniellehrner daniellehrner commented Nov 11, 2022

Signed-off-by: Daniel Lehrner daniel.lehrner@consensys.net

PR description

InteliJ allows to define templates for different files like Java classes, interfaces,... If those templates are saved in the project they are saved as .java files in a subdirectory of .idea.

Such a template looks for example like this:

#parse("Copyright Besu.java")
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
public class ${NAME} {
}

Spotless currently tries to check this templates, because it is configured to analyze all Java files. This check will fail, because the templates are not valid Java code.

This PR excludes all the files in the .idea directory from the spotless check to avoid those false positives.

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if
    updates are required.

Changelog

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
build.gradle Outdated
Comment on lines 131 to 132
target '**/*.java'
targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**'
targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**', '.idea/**'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than one-by-one exclusions we should have a more focused inclusion.

Suggested change
target '**/*.java'
targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**'
targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**', '.idea/**'
target 'src/**/*.java'
targetExclude 'src/reference-test/**', 'src/main/generated/**', 'src/test/generated/**', 'src/jmh/generated/**'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. That is much better. I've changed it.

@daniellehrner daniellehrner merged commit 78c6806 into hyperledger:main Nov 14, 2022
@daniellehrner daniellehrner deleted the spotless_ignore_.idea branch November 14, 2022 15:57
wcgcyx pushed a commit to wcgcyx/besu that referenced this pull request Nov 16, 2022
Signed-off-by: wcgcyx <wcgcyx@gmail.com>
macfarla pushed a commit to macfarla/besu that referenced this pull request Jan 10, 2023
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
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

Successfully merging this pull request may close these issues.

3 participants