A C source code style checker..
This style marker should enforce the rules outlayed in the 'csse2310-style-guide.pdf' which was created for the computer science course 'CSSE2310' at the University of Queensland.
Simpatico tokenises the file, then uses a modified recursive descent parser to step through the code and check qualitative issues. Headers are processed recursively, with system headers being pre-processed for types for simplicity.
After the automarker is complete the course tutors must go through the generated errors to validate the process and catch any qualitative errors.
Each style error must be declared in the format: filename:lineNumber: [CATEGORY] Description
The categories are roughly described below. More details are given in
rules.md
and in csse2310-style-guide.pdf
.
- variables
- defines
- functions
- typedefs
- space before brace
- correct placement
- correct alignment
- multiples of four spaces
- nesting correctly indented
- line continuation
- grammatical spacing around assignment operators
- correctly spaced vertically
- globals
- functions (parameters esp.)
- lengthy or tricky code
- no function over 50 lines
- modularity / no excessive duplication of code
- all lines must be shorter than 80 chars long (including \r)
./simpatico.py file1.c file2.c ...