check some norm for you
- 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
- ...
this is not the latest normatrix but : link (this workflow pass well, but it will not if you copy the code below)
USAGE:
make [-C path/to/NorMatrix] [rule] [VAR=VALUE]
DESCRIPTION:
check the norm!
ARGS:
-C path/to/NorMatrix if you are on another working directory
than NorMatrix, add this.
rule the rule to execute ('all', 'update',
'up', 'tests_run'). If you dont say
any rule, it will do the 'all' rule.
VAR=VALUE to set a different value for a
specific var. Allow to change the
directory to check.
you will probably do:
make -C path/NorMatrix PATH_CHECK=$PWD
USAGE:
./exec.sh
DESCRIPTION:
call the makefile for the all rule with PATH_CHECK to your current
working directory
ARGS:
NO
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
- name: NorMatrix
run: make -C NorMatrix/ PATH_CHECK=$PWD
' > .github/workflows/normatrix_check.ymlwith this, you will can just write normatrix in a shell and it will check
the norm for your current working directory
if you are using bash shell:
echo alias normatrix="$PWD/exec.sh" >> $HOME/.bashrcif you are using zsh shell:
echo alias normatrix="$PWD/exec.sh" >> $HOME/.zshrcelse, handle thsi yourself bruh
if you want to add some checkers (in python, bash, or node), add a file in src/ folder with a filename clear enouth.
if the filename is test.sh, the file wiil be executed like this ./src/test.sh {file to check}
If there is one error or more, exit with the number of error, else status code 0. You must print the filename and the line where the error is
[more preicse information on the file : CONTRIBUTING.md]
chempa for his sample of file that dont follow the epitech norm