Any reason not to adopt SpiderMonkey's check_spidermonkey_style.py? It
deals almost exclusively with header and include related things, and not
indent levels, line lengths, or other things that gecko style disagrees
with.

https://dxr.mozilla.org/mozilla-central/source/config/check_spidermonkey_style.py

"""

#----------------------------------------------------------------------------#
This script checks various aspects of SpiderMonkey code style.  The
current checks are as# follows.## We check the following things in
headers.## - No cyclic dependencies.## - No normal header should
#include a inlines.h/-inl.h file.## - #ifndef wrappers should have the
right form. (XXX: not yet implemented)#   - Every header file should
have one.#   - The guard name used should be appropriate for the
filename.## We check the following things in all files.## - #includes
should have full paths, e.g. "jit/Ion.h", not "Ion.h".## - #includes
should use the appropriate form for system headers (<...>) and#
local headers ("...").## - #includes should be ordered correctly.#   -
Each one should be in the correct section.#   - Alphabetical order
should be used within sections.#   - Sections should be in the right
order.#   Note that the presence of #if/#endif blocks complicates
things, to the#   point that it's not always clear where a
conditionally-compiled #include#   statement should go, even to a
human.  Therefore, we check the #include#   statements within each
#if/#endif block (including nested ones) in#   isolation, but don't
try to do any order checking between such
blocks.#----------------------------------------------------------------------------
"""



On Mon, Mar 28, 2016 at 3:54 PM, Cameron McCormack <c...@mcc.id.au> wrote:

> David Keeler:
> > The style guidelines at
> >
> https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style
> > indicate that #includes are to be sorted. It does not say whether or not
> > to consider case when doing so (and if so, which case goes first?). That
> > is, should it be:
> >
> > #include "Foo.h"
> > #include "bar.h"
> >
> > or
> >
> > #include "bar.h"
> > #include "Foo.h"
>
> If you are preparing to make some changes to the Coding style document
> around #include order, can you also please prescribe (a) where system-
> includes get placed, e.g.
>
> #include "aaa.h"
> #include <bbb.h>
> #include "ccc.h"
> #include <ddd.h>
>
> or
>
> #include <bbb.h>
> #include <ddd.h>
> #include "aaa.h"
> #include "ccc.h"
>
> and (b) how includes with paths are sorted, e.g.
>
> #include "aaa.h"
> #include "bbb/bbb.h"
> #include "bbb/ccc/ddd.h"
> #include "bbb/eee/fff.h"
> #include "bbb/ggg.h"
> #include "ccc.h"
>
> or
>
> #include "bbb/ccc/ddd.h"
> #include "bbb/eee/fff.h"
> #include "bbb/bbb.h"
> #include "bbb/ggg.h"
> #include "aaa.h"
> #include "ccc.h"
>
> or some other order that makes sense.
>
> --
> Cameron McCormack ≝ http://mcc.id.au/
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to