gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
194 stars 72 forks source link

Severe whitespace errors in most of the .java filed #163

Closed MaZderMind closed 5 years ago

MaZderMind commented 5 years ago

Most of the .java-Files contain severe whitespace errors (mixed spaces/tabs, traling whitespace and such) which makes it quite difficult to edit in an IDE without touching hundreds of files. I'd suggest doting a general whitespace-cleanup commit, maybe acompanied by a Checkstyle based linting in the CI Process.

neilcsmith-net commented 5 years ago

If your IDE is making it that problematic, maybe time to switch IDE! :wink: Or at least switch it off for this project.

I understand your frustrations with this, but it's better than it was and definitely not "most". A lot of the files outside of lowlevel were run manually through the NetBeans formatter as they were checked off for 1.0, but I missed a few. These can be fixed as those files are touched again, although not against a whitespace fix for them. I don't intend to change whitespace under lowlevel for the foreseeable future. If we can easily checkstyle without enforcing changes there then something to consider.

MaZderMind commented 5 years ago

It's certainly not my IDE. Just picked the three files I hat at hand:

to pick only some. Sure I can disable all Autoformatting (And I certainly do not expect my settings to match a 3rd party Project, but this will not solve the actual inconsistencies in the Code.

MaZderMind commented 5 years ago

Edit Sorry if I seemd frustrated, that is not the case. I'd be happy to follow any coding style readable from the sources, but the Files seem to be mixing styles without any pattern, so I'm unable to recognize something to follow.

Please do not read this as an attack but as a suggestion to clean things up. Running "Reformat Code" in IntelliJ (or the equivalent in Eclipse) on the top-level directory would probably harmonize most locations with next to no manual work.

neilcsmith-net commented 5 years ago

Do understand that I share some frustrations with the existing formatting - it's a 12+ year old codebase that didn't have a lot of rules! What I meant with the IDE comment was that the IDE should allow you to tread lightly - it should not make "it quite difficult to edit in an IDE without touching hundreds of files" was my point.

As I said, I already ran NetBeans' code formatter over most of the public API files on a file-by-file basis - things were far worse before! A few files were accidentally missed there though - Structure unfortunately being one. The key thing is that at this time I do not want to run across either lowlevel or tests.

MaZderMind commented 5 years ago

Hm I don't understand the reason why you don't want to reformat the Codebase but I'm fine with you, as the maintainer, making this decision. I'd leave it up to you if you want to keep the Issue open as a reminder that this might be a Point that can be made better in the future of if you want to close it.

Thank you anyway :)

neilcsmith-net commented 5 years ago

Should have explained - trying to keep diffs between files from elsewhere (pre-fork, etc.) as clean as possible. I do want it to be cleanly formatted eventually, just that's less of a priority in lowlevel and tests right now. Most of the rest has already been reformatted (there are no tabs in Structure.java btw!)

MaZderMind commented 5 years ago

Ok, I see that you have a reason to keep the Status Quo and that you know about the Problem.

I can see keeping Diffs low being useful, if 3rd parties maintain private Forks, but I still think that a general "for x.y we'll do a reformat, brace for impact" kind of re-formatting would help the Project in the long run.

For the time being I'll close this issue since I can see that there is no immediate fix possible or desired. Finally, thank you for the explanations!