[ 
https://issues.apache.org/jira/browse/HBASE-27096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17552088#comment-17552088
 ] 

Nick Dimiduk commented on HBASE-27096:
--------------------------------------

bq. No, it will not automatically ignore files not in the source control.

Bummer. I filed https://github.com/diffplug/spotless/issues/1232

bq. And we still need the eclipse-formatter file, spotless will use it to 
format our code.

Ah, true. I guess all IDEs can read Eclipse's formatter configuration, so I 
agree that this is fine as our configuration of reference.

bq. And checkstyle, it has some rules which are not covered by spotless. For 
example, the naming convention., as spotless can not change the name of your 
variables. But for the rules of indentation, I think we could just drop them. 
HBASE-26918 is for it.

Great!

bq. And for the problem here, I suggest we just exclude all the files under 
.idea. And for the checkstyle-idea.xml, we move it to dev-suppport, just like 
what we have for eclipse formatter and template. When setting up the workspace, 
the developers can import these files to their IDE.

At one point, I was working on adding other files to the .idea directory, so 
that a new developer could check out our repository and it would "just work". 
However, due to some weird limitations in IDEA, I think this is not possible. 
So yes, let's move {{.idea/checkstyle-idea.xml}} to {{dev-support}} and update 
the book on how to adopt it. Maybe a symlink will work. I filed HBASE-27102 for 
this.

Thanks [~zhangduo].

> Exclude files which are not in source control as much as possible when 
> running spotless
> ---------------------------------------------------------------------------------------
>
>                 Key: HBASE-27096
>                 URL: https://issues.apache.org/jira/browse/HBASE-27096
>             Project: HBase
>          Issue Type: Improvement
>          Components: build, pom
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>            Priority: Major
>
> In HBASE-27084, we added spotless:check to mvn verify stage, but the general 
> format section in spotless will include some files which are not in source 
> control, such as .idea/* or .settings/*, and then fail the 'mvn install'.
> Although usually it could be fixed by a spotless:apply call, but IDE may 
> regenerate the file and fail the build again.
> Let's add more exclude patterns to make it work better.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to