Assessing style compliance as == clang-format(whole file) is by far the
easiest to implement. I'd be in favor of a flag day (or set of mini flag
days) where we mass rewrite the tree with clang-format's output.


To be honest, I don't care WHICH particular style we follow, but
please set the flag day soonish so that
mass rewrite is done.

It is really bothering to realize that some existing files do
not follow the supposed mozilla coding style and even
occasionally conflict
with the modeline at the beginning of that file after all
these discussions.

Finding that I have to tweek the indentation every
time I hit the enter key to fix something in a file
is annoying.

Either a flag day for the ENTIRE tree, or by top-most directories, ought to be implemented. Maybe someone can check the statistics and the month where the number of patch submissions is lowest ought to be picked up and the flag day can be set there.

Just a thought.

BTW, I use emacs and it can handle a lot of different styles.
So emacs users should have no problem except for one thing.

Unfortunately, it does not handle the particular coding style of
#if,#else,#endif in JavaScript source files since
use of C-style macro preprocessor is not quite standard.

Nobody seems to have written a emacs mode for this C-style macro use in JavaScript code. Correct me if I am wrong on this point.
(When I tried to indent some broken JavaScript source files
it could not handle #if,#else,#endif, etc. very well.)

I wonder if there is an automatic formatter for JavaScript
that handles this particular issue of non-standard C-preprocessor usage.

If not, we may be forced to rewrite such macro usage into

BEFORE:
#if defined(WIN32)
    blabla
#else
    gazonk-foobar
#endif

AFTER
    if(C.system_win32) {
     blabla
    } else {
     gazonk-foobar
    }

or something like that (modulo the correct positioning of "{", "}", "else") by introducing system-wide constant that defines system types. Run-time overhead should be minimal given the modern JS interpreter and optimizing JIT compiler.

Just a thought.



_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to