check epitech c coding style
Project description
NorMatrix
check some norm for you
install
With Pipy
with pipy
pip install normatrix
Now you can use it with python3 -m normatrix
in your terminal
And if you want to just write normatrix
:
echo $SHELL
if you are using bash shell (the echo
print /something/bash
):
echo alias normatrix=\"python3 -m normatrix\" >> $HOME/.bashrc
else if you are using zsh shell (the echo
print /something/like/zsh
):
echo alias normatrix=\"python3 -m normatrix\" >> $HOME/.zshrc
else handle this yourself bruh;
From source
from source
git clone https://github.com/Saverio976/NorMatrix.git
cd NorMatrix
Now you can use it with ./path/to/folder/NorMatrix/main.py
in your terminal
And if you want to just write 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;
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)
- no space after [ and space before ]
- ...
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
--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
--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
--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
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)
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: set up python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- 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
File details
Details for the file normatrix-0.2.7.tar.gz
.
File metadata
- Download URL: normatrix-0.2.7.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47c63e55525925d139af7ebc90a87a965f39f4cd760d365f9d414aa4ecf320f0 |
|
MD5 | 2cfedcea7e87a35b07a618c2304f1c5f |
|
BLAKE2b-256 | 3aaa1ce1877f8b5a378e5a50e6982b79df2d04de567168a4fc14672d41190079 |
Provenance
File details
Details for the file normatrix-0.2.7-py3-none-any.whl
.
File metadata
- Download URL: normatrix-0.2.7-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a6c3e0d88141d37c80a3e0b1c512918df90577120451ef5b0363bc759b5b9a8 |
|
MD5 | 10d25f40abd5e3820da61324dc5da7b3 |
|
BLAKE2b-256 | 8d1ab7ea465250bd4d7fad369527fba9901f55a2cb6a9f6d9f1d06ad724b5f0e |