check epitech c coding style
Project description
NorMatrix
check some norm for you
install
with pipy
pip install normatrix
echo $SHELL
if you are using bash shell (the echo
print /something/bash):
echo alias normatrix=\"python -m normatrix\" >> $HOME/.bashrc
else if you are using zsh shell (the echo
print /something/like/zsh):
echo alias normatrix=\"python -m normatrix\" >> $HOME/.zshrc
else handle this yourself bruh;
now you can just write normatrix
on your shell
from source
git clone https://github.com/Saverio976/NorMatrix.git
cd NorMatrix
echo $SHELL
if you are using bash shell (the echo
print /something/bash):
echo alias normatrix=\"$PWD/main.py\" >> $HOME/.bashrc
else if you are using zsh shell (the echo
print /something/like/zsh):
echo alias normatrix=\"$PWD/main.py\" >> $HOME/.zshrc
else handle this yourself bruh;
now you can just write normatrix
on your shell
Current Checks
- 80 cols per line
- space/tab alone (in a line)/(at the end of line)
- two newline at end of file
- two newline between function (between all buf chhhtt)
- libc function call (pr welcome to add some libc function always banned)
- nested branch more than 3 branch
- no more than 20 lines per function
- comma with no space after
- end of parenthesis with a open curly bracket next
){
- star char
*
like thischar* buf
- preprocessors indentations (
#if..
,#endif
) - multiple statements
- 5 functions per file
- filename of source code only snake_case
- no line break at end of file
- 5+5 7/9 that need a space (but some false positiv goes in)
- ...
example if you run it as a github workflow
this is not the latest normatrix but : link (this workflow pass well, but it will not if you copy the code below)
doc
(if you use pipy) python -m normatrix
usage: python -m normatrix [-h] [--tests-run] [--no-operators-pluggin] [paths ...]
The C Epitech Coding Style Norm Checker
positional arguments:
paths list of path to check (default: the current working directory)
options:
-h, --help show this help message and exit
--tests-run if you want to execute the tests (default: execute the norm checker)
--no-operators-pluggin
remove the operators pluggin (because it print some false positiv for now)
(only from source) main.py
usage: ./main.py [-h] [--tests-run] [--no-operators-pluggin] [paths ...]
The C Epitech Coding Style Norm Checker
positional arguments:
paths list of path to check (default: the current working directory)
options:
-h, --help show this help message and exit
--tests-run if you want to execute the tests (default: execute the norm checker)
--no-operators-pluggin
remove the operators pluggin (because it print some false positiv for now)
(only from source) exec.sh
(this file exists only to keep compatibility to older version)
usage: ./exec.sh [-h] [--tests-run] [--no-operators-pluggin] [paths ...]
The C Epitech Coding Style Norm Checker
positional arguments:
paths list of path to check (default: the current working directory)
options:
-h, --help show this help message and exit
--tests-run if you want to execute the tests (default: execute the norm checker)
--no-operators-pluggin
remove the operators pluggin (because it print some false positiv for now)
(only from source) Makefile
(this file exists only to keep compatibility to older version)
USAGE:
make -C path/to/NorMatrix PATH_CHECK=$PWD
DESCRIPTION:
check the norm! in the current working directory
(call main.py)
ARGS:
-C path/to/NorMatrix run the makefile that is in path/to/NorMatrix
instead of the one where you are
PATH_CHECK=$PWD check the norm in your current working
directory
run it as a github workflow
in the repo root :
mkdir .github
mkdir .github/workflows
echo '
name: NorMatrix Check
on: [push]
jobs:
norm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clone NorMatrix
run: git clone https://github.com/Saverio976/NorMatrix.git
- name: NorMatrix
run: ./NorMatrix/main.py
' > .github/workflows/normatrix_check.yml
Contribute
[more information on CONTRIBUTNG.md]
special thanks
chempa for his sample of file that dont follow the epitech norm
contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for normatrix-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41e1d863bf0e0f76c15d6bf637ba78f1ebf046c48599baa1120b9d60cbd14bad |
|
MD5 | b8cc5e62b7a700beef28a9e41e5f3b2e |
|
BLAKE2b-256 | 433f51a1d24d10e91336e90612bdc7068780905ad2235ba053ef6c2886dd9e8d |