Skip to main content

No project description provided

Project description

NorMatrix

check some norm for you

ubntu-latest , windows-latest, macos-latest, (python3.7, python3.8, python3.9, python3.10)

install:

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

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

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

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

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 this char* buf
  • preprocessors indentations (#if.., #endif)
  • multiple statements
  • 5 functions per file
  • filename of source code only snake_case
  • ...

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

main.py

USAGE:
	./main.py [tests\_run]
DESCRIPTION:
	check the norm! in the current working directory
ARGS:
	NO		check the norm
	tests_run	run internal tests of NorMatrix

exec.sh

(this file exists only to keep compatibility to older version)

USAGE
	./exec.sh [tests\_run]
DESCRIPTION:
	check the norm! in the current working directory
	(call main.py)
ARGS:
	NO		check the norm
	tests_run	run internal tests of NorMatrix

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

python -m normatrix

USAGE:
	python -m normatrix [tests\_run]
DESCRIPTION:
	check the norm! in the current working directory
ARGS:
	NO		check the norm
	tests_run	run internal tests of NorMatrix

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]

thanks

chempa for his sample of file that dont follow the epitech norm

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

normatrix-0.1.7.tar.gz (11.0 kB view hashes)

Uploaded Source

Built Distribution

normatrix-0.1.7-py3-none-any.whl (16.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page