Skip to content

Latest commit

 

History

History
executable file
·
187 lines (122 loc) · 7.85 KB

README.md

File metadata and controls

executable file
·
187 lines (122 loc) · 7.85 KB

Abricot Reborn

During your projects you may be tempted to quickly and intuitively check your style mistakes thanks to a tool called Automated Beautiful Recursive Integrated Coding Omissions Tracker, better known as Abricot

More seriously, the Abricot development team has been thinking for some time about a more modern and more stable implementation of the norminette. This new year for Epitech is an opportunity to make it compliant with current coding style rules.

Installation

Because we wanted to stay simple, there is one and only command to install Abricot:

curl https://raw.githubusercontent.com/Just1truc/Abricot-Norminette/main/get_abricot.sh | sh

Imagine having to pull a docker image to run a norminette... 😒

Usage

We wanted to make Abricot usable at any time, without requesting superuser permissions and without creating intermediate files polluting your workspace.

You can launch a deep analysis with Abricot with the following simple command:

abricot

You can also take a look at all the additional features implemented with:

abricot -h

Updating

Updates are regulary made.
To keep Abricot up-to-date, please use the following command :

abricot --update

Checked files

Here are the files affected by Abricot's style check:

C Source Files (*.c)

C Header Files (*.h)

Makefiles

Abricot also looks for unwanted files in the repository...

Handled rules

Severities:

  • MAJOR
  • MINOR
  • INFO

Global scope

  • C-G1 Bad file header
  • C-G2 There should be only one line between each fonction
  • C-G3 Preprocessor directive must be indented
  • C-G4 Global Variable must be const
  • C-G5 #include should only contain .h files
  • C-G6 Line endings must be done in UNIX style
  • C-G7 Line should finish only end with a "\n"
  • C-G8 Trailing space
  • C-G9 Constant values

Control structure

  • C-C1 There should not be more than 3 depth (conditionnal branching)
  • C-C3 Forbidden goto

Advanced

  • C-A3 Missing Line Break

Layout inside a function scope

  • C-L1 Coding content
  • C-L2 Bad indentation
  • C-L3 Misplaced spaces
  • C-L4 Misplaced curly bracket
  • C-L5 Bad variable declaration
  • C-L6 Bad line break

Files organization

  • C-O1 Check useless file
  • C-O3 Too many fonctions in a file
  • C-O4 Snake case convention

Functions

  • C-F3 A line lenght shoud not exceed 80 columns
  • C-F4 A function should not exceed 20 lines
  • C-F5 More than 4 arguments in a function or argumentless function
  • C-F6 Comments inside of functions

Header files

  • H2 Header not protected from doucle inclusion

Variables and Types

  • V1 Controlling structures and macros
  • V3 Pointers position

Performances

Another really important point for us is performance.

Abricot Norminette uses multi-threading, a smart caching policy and is regularly profiled in search of optimization opportunities.

Here's a small report of what we got as benchmark:

On a ~20 files project:

🍑 Abricot 🍌 Banana
0.73s 2.67s

On a ~30 files project:

🍑 Abricot 🍌 Banana
0.98s 5,38s

On a ~50 files project:

🍑 Abricot 🍌 Banana
2.09s 2m01s

Banana reported 0 coding style errors on this project

Compatibility

Python3+ should be installed on your computer for Abricot to work.

OS Compatible ?
Debian based
Fedora based
macOS
Windows ⚠️ WSL advised

Credits

Lead Developper : Justin Duc

linkeding bage git hub bage mail

Architecture Designer : Mathias André

linkeding bage git hub bage mail

Performances Responsible : Valentin Nouri

linkeding bage git hub bage mail

Quality Responsible : Thomas Mazaud

linkeding bage git hub bage mail

Tests Maker : Baptiste Leroyer

linkeding bage git hub bage mail