Best_Practices icon indicating copy to clipboard operation
Best_Practices copied to clipboard

Programmatically check/enforce "agreed upon" style and conventions

Open zbeekman opened this issue 8 years ago • 7 comments

AKA make a "linter" or style audit tool.

It would be great to be able to have a tool to check conformance of program source code to a set of style guides, as well as check for dubious constructs. Ideally such a tool would have the ability to include or exclude individual rules, and print warnings showing the offending constructs, their line number, and which file they are found in, along with an exit status to indicate success (no offenses) or failure. Additionally it would be wonderful to be able to add custom rules in a simple syntax, to allow projects that don't agree with the set of common guidelines we come up with to add their own.

Obviously, this is a very long term goal, and to a degree I may be putting the cart before the horse here: First we need to come to a consensus, or at least a compromise, of what the rules of style are, before we start thinking of ways to detect whether or not they are being violated.

Additionally we're going to need to consider how to implement such a tool: Do we need a full parser for the entire Fortran language, or could we do something more quick and dirty based on regular expressions etc.

Also, if we decide to create such a tool what language etc. should we use? We could use Fortran itself, however, even with some nice recent improvements like deferred length characters and reallocation on assignment, other languages, like Python, might be quicker and easier to implement such a tool.

zbeekman avatar Jan 12 '16 12:01 zbeekman