opencast / opencast

The free and open source solution for automated video capture and distribution at scale.
https://opencast.org
Educational Community License v2.0
398 stars 235 forks source link

Reformat code according to checkstyle #2238

Open LukasKalbertodt opened 3 years ago

LukasKalbertodt commented 3 years ago

Starting with #2216, we have some checkstyle-rules which have exceptions defined for specific files/modules. We want to get rid of those exceptions one by one. So this issue tracks the progress of correctly formatting the code and removing those exceptions in checkstyle-suppressions.xml.

I plan on doing a good chunk of this work myself, but obviously, there is a lot to do. Both, fixing the code and reviewing all the changes will take quite some time. In case this helps anyone, my workflow for this is roughly like this:

My workflow for working on this - Temporarily set `` and `` to `false` in `pom.xml` - Remove one or multiple line from `checkstyle-suppressions.xml` - *Note*: if you remove one line for module `foo`, you should probably remove all lines for that module, including other style rules. If you are working on some files anyway, it's probably best to fix all issues at once. - Run `mvn checkstyle:check 2>&1 | grep "\[ERROR\]"` - Use the output of that command to somehow quickly open files in your editor. For example, I use Sublime Text and I would process that output such that I get a file with lines in the format `filename.java:linenumber`. Then, I can do the following: - ctrl+x to cut the current line - ctrl+p & ctrl+v & enter to navigate to that file and to the specific line number - Fix the code - ctrl+s & ctrl+w & repeat

Modules

If modules get fixed, this list should be updated (I imagine enough people can edit this comment, so that should be fine). The numbers in parenthesis mean count the different violations:

  1. Line length
  2. Braces
  3. Indentation
gregorydlogan commented 1 year ago

This appears to be done

LukasKalbertodt commented 1 year ago

Nope, it is unfortunately not done yet :/ Checkstyle is still disabled for quite a number of modules. I just didn't have time to work on this anymore.