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.
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... 😒
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
Updates are regulary made.
To keep Abricot up-to-date, please use the following command :
abricot --update
Here are the files affected by Abricot's style check:
Abricot also looks for unwanted files in the repository...
- 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
- 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
- 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
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:
🍑 Abricot | 🍌 Banana |
---|---|
0.73s | 2.67s |
🍑 Abricot | 🍌 Banana |
---|---|
0.98s | 5,38s |
🍑 Abricot | 🍌 Banana |
---|---|
2.09s | 2m01s |
Banana reported 0 coding style errors on this project
Python3+ should be installed on your computer for Abricot to work.
OS | Compatible ? |
---|---|
Debian based | ✅ |
Fedora based | ✅ |
macOS | ✅ |
Windows |