jruby / jruby

JRuby, an implementation of Ruby on the JVM
https://www.jruby.org
Other
3.79k stars 923 forks source link

Clean up and Rubify all pom.rb files #8327

Open headius opened 3 months ago

headius commented 3 months ago

We have many pom.rb files with peculiar code styles, mostly stemming from changing coding conventions over time and improvements in Ruby like the new keyword syntax. There's also unusual indentation and inconsistent use of symbols versus strings and colon-hashes versus hashrockets. This makes maintaining the build scripts annoying and if we start using newer conventions in part of a file it looks inconsistent with the rest of the file.

I propose that we do a sweep for JRuby 10 to clean up Ruby syntax in these files and consistently apply modern Ruby coding conventions.

This will necessarily split the history of these files, but it's a band-aid that needs to be ripped off eventually. Doing this in JRuby 10 makes sense because there will be other large-scale changes for Java 17+ and modularity that will also make forward-merging difficult or impossible.

A partial list of files that should be addressed:

There may be other pom.rb or Mavenfile files that could use similar attention.

Bonus round: wire up an automated linter or code convention auditor to help ensure the files stay clean.

Work should be done on the 9.5-dev branch until we have merged that back to master for JRuby 10.

headius commented 3 months ago

@mkristian @enebo Another effort I think would be worth it for JRuby 10. This would make the build more approachable both for us and for new users getting familiar with JRuby development. I think we've all been frustrated from time to time with the inconsistent coding conventions throughout our build scripts.

enebo commented 3 months ago

Stylistically I don't have any opinion. Making it one style will not hurt though. My suggestion is I forget which pom.rb contains things like core has java daps and lib has ruby gem deps. Not sure if we could consolidate these into a single top-file but it might make it simpler if we could what I consider config data (e.g. things we routinely update) in one place.

headius commented 3 months ago

That may be possible but I'm not sure of the best approach. Maven really wants submodules in their own dirs with their own poms, so this isn't as much a factor of our polyglot ruby scripts as it is just the way Maven structures things.

headius commented 3 months ago

Ideas from Matrix discussion: