bytecode-viewer
bytecode-viewer copied to clipboard
Consider adding automatic formatting
While working with the codebase I found the codestyle across files to be quite incosistent. This probably results from no well-defined code style. I think it would be worthwhile to configure a plugin like https://github.com/diffplug/spotless/tree/main/plugin-maven to automatically apply formatting through a maven task. This would also allow to enforce the codestyle through a CI task. Any thoughts?
I think having formatting handled automatically with maven is a great idea, I'm not sure how to go about setting this up yet but I will definitely look into this!
My goto way to do this is to specify the formatting using the config file for the eclipse jdt formatter (https://github.com/diffplug/spotless/tree/main/plugin-maven#eclipse-jdt), which you can simply export from eclipse after configuring the formatting to your liking. If you provide the file I could do the maven/CI configuration for you.
Another possibility would be CheckStyle, but in my experience, it is very limited when it comes to special rules for newlines and so on. A completely other approach would be a editor config file which is even more limited, but configures the auto formatter of most well known editors automatically at least. A hybrid approach using an editor config file and some maven plugin that applies rules specific to java files and so on would be the best I think.
You’ll have to be careful to configure both such that both config and plugin don’t contradict each other. Notably the eclipse config can be used both with eclipse and IntelliJ (through a plugin). Not sure about Netbeans though.