qctools icon indicating copy to clipboard operation
qctools copied to clipboard

Code style

Open richardpl opened this issue 6 years ago • 13 comments

Can this be fixed at all?

Mixed tabs and spaces & mixed indentations are worst offenders.

richardpl avatar Mar 24 '18 14:03 richardpl

+1

dericed avatar Mar 24 '18 15:03 dericed

+1

retokromer avatar Mar 24 '18 15:03 retokromer

Preference for existing styleguide or (even better) linter?

ablwr avatar Mar 25 '18 01:03 ablwr

https://www.ffmpeg.org/developer.html#Code-formatting-conventions

dericed avatar Mar 25 '18 01:03 dericed

FFmpeg is a good example indeed! (The only detail I don’t like is indent 4, because 2 is fully sufficient in my opinion.)

retokromer avatar Mar 25 '18 04:03 retokromer

This is not only about tabs vs spaces. Currently QCTools uses mix of multiple naming conventions for functions/classes. Fixing all this looks like pretty big task. But after doing it right, code checker could probably be integrated into Travis to early notify about all the violations.

ElderOrb avatar Mar 25 '18 07:03 ElderOrb

Fixing all this looks like pretty big task.

Indeed, yet a good code editor helps a lot.

retokromer avatar Mar 25 '18 07:03 retokromer

As for the code conventions, I would suggest to follow the ones from Qt. I don't mind ffmpeg's ones but QCTools is Qt-based C++ application after all.

https://wiki.qt.io/Qt_Coding_Style https://wiki.qt.io/Coding_Conventions

ElderOrb avatar Mar 25 '18 07:03 ElderOrb

No point in doing it manually if job can be automated. I propose to run it under indent -kr -nut to fix issues and also to remove trailing spaces and tabs.

richardpl avatar Mar 25 '18 17:03 richardpl

+1 +1 +1

ablwr avatar Mar 25 '18 17:03 ablwr

No point in doing it manually if job can be automated.

Of course not! I personally use BBEdit since years, which does this.

retokromer avatar Mar 25 '18 17:03 retokromer

So, anything gonna happen anytime soon? Or I need to do it?

richardpl avatar Jul 12 '19 09:07 richardpl

Be the change you want to see in the world, @richardpl

ablwr avatar Jul 12 '19 13:07 ablwr