Le 15/10/2016 à 11:06, Pascal a écrit :
> Here is a proposal for Gnoga coding guidelines:
> Version numbering: m.n with m major version number , n minor version
> number. -alpha is added on m.n when this version is created, to be
> used without any warranty. -beta is added on m.n when this version
> is enough mature to be tested. Then a letter is added on m.n when
> this version becomes a stable reference release (fully tested). The
> letter is incremented when fixes come. For instance : 1.2-alpha,
> 1.2-beta, 1.2a, 1.2b, 1.2c…
For the rest, I volunteer to provide an AdaControl rules file to enforce
> Header: Several lines of fixed comments customized with the name of
> the unit, the creation date and the name of the author.
Needs a template, can be checked by AdaControl
> Purpose of the unit: Several line of comments indicating the purpose
> of the unit after header and before first declaration.
> Coding style: Line length is limited to 120 characters. Ada keyword
> are in lower case. Ada entities are in mixed case with an underscore
> to separate words.
> Getter and setter names are identical as Ada provides function for
> getters and procedure for setters.
This is current practice in Gnoga, however I'm not so much in favour of
it, because it prevents the usual usage that functions names are names
or adjectives, while procedure names are verbs. Presumably too late to
change for Gnoga.
I would be interested in having a more formal definition of this rule
(i.e. what could be checked here?). Maybe an opportunity to add
something to AdaControl.
> Entity description is lines of comments below the entity declaration.
> Gnatdoc annotations are recommended, see
Ada contracts Pre, Post and type invariant are recommended.
OK, but not checkable as long as it is "recommended" and not "required"
> Ada type entity is ending with "_Type" for a common type, "_Access"
> for an simple access type, "_Class" for an access to class type.
> Functions and procedures must be declared before coding the body.
Not sure it is very useful. I don't have a rule for this in Adacontrol,
but it could be easily added.
> Use clause is restricted to minimum use, preferably local use to
> functions or procedures. Use type clause is recommended.
> Code reformat is recommended before commit to Gnoga repository.
Not really checkable...
> Syntax check is mandatory before commit to Gnoga repository.
I'd rather say that every commit must compile! (not only syntax checks)
> For debug builds, most warnings, runtime verifications and exception
> tracebacks are recommended.
(including enabling all assertions)
> For release builds, runtime verifications disabled and optimisations
> enabled are recommended.
I'm OK for disabling assertions, but not other checks (constraint_error...)
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Gnoga-list mailing list