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.
If/when this project becomes more reliable than the previous implementations of the automarker then the tutors of this course will swap over to using 'simpatico' for their marking.
Also, many hours of marking time is quite expensive for such a menial task, and this project could save money as well as time and effort.
Currently a C++ program called 'vera++' tokenises the C source code input and feeds it to a very large tcl script which generates the errors.
This script has many issues and is terribly hard to modify. One of the major problems with the current script is that it generates a large number of style errors for validly styled C code.
After the automarker is complete the course tutors must go through the generated errors extremely carefully to validate the process. Very frequently the tutors make mistakes.
Each style error must be declared in the format: filename:lineNumber: [CATEGORY] Description
The categories and potential error messages are listed below. More details are given in
rules.md
and in csse2310-style-guide.pdf
.
Potential error messages:
- File naming error: filename
- Variable naming error: name
- #define naming error: name
- Function naming error: name
- Type naming error: name
Potential error messages:
- (TODO)
Categories:
- space before brace
- correct placement
- correct alignment
Potential error messages:
- (TODO)
Categories:
- multiples of four spaces
- nesting correctly indented
- line continuation
Potential error messages:
- No space around operator
- No space after ,
- No space after ;
- No vertical space between functions
(operator will be one of =
, +=
, &=
, etc.)
Further categories:
- Appropriate vertical whitespace
Potential error messages: (none automatically generated)
Categories:
- globals
- functions (parameters esp.)
- lengthy or tricky code
Potential error messages:
- Function name is n lines
- Use of goto
Further categories:
- modularity / no excessive duplication of code
Potential error messages:
- Line is n characters
./simpatico.py file1.c [file2.c ...]