You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Uwe Schindler (Jira)" <ji...@apache.org> on 2021/07/06 17:03:00 UTC

[jira] [Created] (SOLR-15521) Cleanup gitattributes and align to spotless config

Uwe Schindler created SOLR-15521:
------------------------------------

             Summary: Cleanup gitattributes and align to spotless config
                 Key: SOLR-15521
                 URL: https://issues.apache.org/jira/browse/SOLR-15521
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Build
    Affects Versions: main (9.0)
            Reporter: Uwe Schindler


I spend the whole afternoon to figure out why checking sportless and after that applying spotless changes, the results can't be committed (git says, only new line changes, although ly local repo is configured NOT to apply line ending normalization).

I was looking at the top-level git attributes config and did not find any problem. After 3 hours searching and trying I figured out why my local changes were not applied:

In Solr's folder is another .gitattributes file, which sets autodetection for *all* files, excapt some list. This will autodetect text files and configure them to use local line endings.

On the other hand, spotless is configured to emit and test for linefeed only (UNIX). When you check spotless on a windows checkout it will find a violation in every Java file!

In Lucene we do not have the problem, because Git is configured to only apply "lf" line endings and spotless writes using lf.

We should change one of this:
- enforce "LF" (Unix line endings for all files) - except batch files. I already did this in a commit for *.java files. Ideally we should do this for all text files and people should configure their IDE.
- reconfigure spotless to recognize the GIT attributes settings (this can be configured and is the default).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org