Skip to content
Coding-style checker for Epitech students. This program analyzes your C source files for Epitech coding-style violations.
Branch: master
Clone or download
Latest commit e4ecb65 Mar 19, 2019

README.md

NormEZ logo

Coding-style checker for Epitech students. This program analyzes your C source files for Epitech coding-style violations.

FR: Moulinette de norme pour les étudiants d'Epitech. Cette norminette cherche des erreurs de norme Epitech dans vos fichers de code source C.

Table of contents

Getting started

Requirements

Installing Ruby on Fedora (Epitech's dump 2017)

sudo dnf install ruby

How to use NormEZ?

Manual installation

  1. Clone the repository:
git clone https://github.com/ronanboiteau/NormEZ
  1. Copy the NormEZ.rb executable in your project repository.
  2. Run NormEZ:
ruby NormEZ.rb
  1. NormEZ will recursively search for .c and .h files to analyze in your current directory.

Arch Linux

AUR package maintained by Florian Glorioz.

  1. Install NormEZ:
yaourt -S normez
  1. Run NormEZ with the following command:
normez

Options

  • -u or --no-update: don't check for NormEZ updates
  • -f or --ignore-files: ignore forbidden files
  • -m or --ignore-functions: ignore forbidden functions
  • -i or --ignore-all: ignore forbidden files & forbidden functions (same as -fm)
  • -c or --colorless: disable all styling on output

Features

Here are the Epitech coding-style violations checked by NormEZ.

Major infraction = major infraction
Minor infraction = minor infraction

Major infraction Lines with too many columns (> 80).
Major infraction Forbidden files: every regular file that does not match Makefile, *.c or *.h (ex: *.o, *.gch, bsq, ...) & that is not mentioned in a .gitignore file located in your current working directory.
Major infraction [Not exhaustive] Too broad filenames (ex: string.c, algo.c, my_algorithm.c, ...).
Major infraction Missing or corrupted header in sources files (.c), headers (.h) & Makefiles.
Major infraction Functions that contain more than 20 lines.
Major infraction Several semicolon-separated assignments on the same line.
Major infraction [Not exhaustive] Forbidden functions (printf(), dprintf(), atoi(), memcpy(), scanf(), strlen()...).
Major infraction Trailing space(s) and/or tabulation(s) at the end of a line.
Major infraction Filenames that don't respect the snake_case naming convention.
Major infraction Condition and assignment on the same line.
Major infraction Directory names that don't respect the snake_case naming convention.
Major infraction Too many functions in file (> 5).
Major infraction Functions with no parameters that don't take void as argument in their declaration.
Major infraction Functions with too many arguments (> 4).
Minor infraction Space(s) in indentation.
Minor infraction Missing space after keyword.
Minor infraction Misplaced pointer symbol(s).
Minor infraction Macros used for constants.
Minor infraction Macros containing multiple assignments.
Minor infraction Too many else if statements.
Minor infraction Misplaced comments.
Minor infraction Missing space after comma.
Minor infraction Missing space around binary or ternary operator (=, ==, !=, <=, >=, &&, ||, +=, -=, *=, /=, %=, &=, ^=, |=, |, ^, >>, <<, >>=, <<=).
Minor infraction Extra space after unary operators (!, sizeof, ++, --).
Minor infraction Forbidden keyword (goto).
Minor infraction Functions must be separated by one and only one empty line in .c files.

To-do

Here are the Epitech coding-style violations NOT YET checked by NormEZ.

Major infraction = major infraction
Minor infraction = minor infraction

Major infraction Typedef not ending with _t.
Major infraction Identifiers that don't respect the snake_case naming convention.
Major infraction Macros, global constants or enums that don't respect the SNAKE_CASE convention (uppercase snake_case).
Major infraction Function prototypes, typedefs, global variables, macros or static inline functions in .c source files.
Minor infraction Single-letter identifiers shouldn't be named l (lowercase L) or o to avoid confusions.
Minor infraction Nested conditonal branchings (depth > 2).
Minor infraction Header files not protected against double inclusion
Minor infraction Wrong indentation level in .c and .h files.
Minor infraction Wrong indentation level in pre-processor directives.
Minor infraction Extra space between function name and opening parenthesis.
Minor infraction Misplaced curly brackets.
Minor infraction Multiple variables declared on the same line.
Minor infraction Variable not declared at the beginning of function.
Minor infraction Missing empty line after variable declarations.
Minor infraction Extra empty lines in function.

Bugs

Known issues

  • NormEZ doesn't make the difference between strings/comments & code. Examples: a commented forbidden function will be flagged, as well as a commented ; (multiple assignments on the same line), etc.
  • The check for functions containing more than 20 lines doesn't work yet with the new coding style v3.1. See related issue.

Report a bug

If you found a bug that isn't listed above in as a known issue, feel free to create a GitHub issue.

Getting involved

Share

  • Enjoying NormEZ? Leave it a star to show your support :)
  • And share the link to this repository with your friends at Epitech!

Contribute

You want to add awesome features to NormEZ? Here's how:

  1. Fork NormEZ
  2. Commit & push a new feature to the forked repository
  3. Open a pull request so I can merge your work in this repository :)

Contributors

Here is the list of NormEZ's contributors. Thanks to everyone who helped developing this project!

You can’t perform that action at this time.