rmuir commented on issue #14819:
URL: https://github.com/apache/lucene/issues/14819#issuecomment-3002202141
closing this out: we're now linting in CI, space and indentation is fixed.
One thing that happened was disabling the `max_line_length`. Personally I'm
ok with that, but if you don't like it, feel free to make a PR as long as
sources are fixed to match :)
I understand the motivation here, to reduce friction with the
autoformatting, which is good thing to want to do, but I really feel, we should
not set such config for any files unless we really adhere to it. Otherwise it
causes problems such as unrelated changes in PRs due to editors.
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:
```
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]