dweiss commented on issue #14819:
URL: https://github.com/apache/lucene/issues/14819#issuecomment-3003720172

   > For `java`, I don't believe `max_line_length` should be set. Current line 
length seems to be `Infinity`: there are enormous values present even exceeding 
thousands of characters long lines. I think spotless allows this in comments 
and string constants and such:
   
   We don't do what they call "long string reflowing". I agree that it 
shouldn't be the editorconfig's responsibility here - apply tidy and it should 
do the job of restoring whatever state is "canonical" for the source.
   
   I may play around with google-java-format - there's more things we have in 
the backlog (for example markdown)... I may just fork it since there doesn't 
seem to be much going on in google's repo.
   
   > 
   > ```
   > 
lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseAnalyzer.java:
   > 215:8001: line is too long (44326 > 8000)
   >         "\u10b47\u10b58\u0020\u0078\u0077\u0020\u0020
   > ...
   > ```
   > 
   > For `python`, the same situation applies. `ruff` formatter is used similar 
to Spotless, but it also allows code comments, string constants, etc to be 
longer than the current `200` line length:
   > 
   > ```
   > dev-tools/scripts/reproduceJenkinsFailures.py:
   > 34:201: line is too long (217 > 200)
   > #         Policeman Jenkins example:           [Lucene-Solr-7.x-Linux] $ 
/var/lib/jenkins/tools/hudson.tasks.Ant_AntInstallation/ANT_1.8.2/bin/ant 
"-Dargs=-XX:-UseCompressedOops -XX:+UseConcMarkSweepGC" jenkins-hourly
   > ```
   > 
   > For least friction with java and gradle, I recommend to run `./gradlew 
tidy` CLI workflow and put `lucene.spotlessGradleScripts=true` into your 
`~/.gradle/gradle.properties`: I don't have a better way.
   > 
   > For python code, I'd recommend to use ruff language server and just 
configure to format and organize imports automatically on save (and/or upon 
request). You'll never think about formatting again. It will pick up our 
configuration from `pyproject.toml`. Really wish the java tools worked like 
this, it is the workflow I use for all other languages too :) 
https://docs.astral.sh/ruff/editors/setup/
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to