Giter Site home page Giter Site logo

vivelis / normatrix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from christophechr/normatrix

0.0 0.0 0.0 267 KB

Python Script To Check The Epitech Coding Style For The C Language (https://pypi.org/project/normatrix/)

License: MIT License

Makefile 1.72% Shell 1.81% C 33.48% Python 62.99%

normatrix's Introduction

NorMatrix

check some norm for you

PyPI version

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

NorMatrix Check

Codacy Badge

GitHub repo size GitHub language count GitHub top language GitHub last commit

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 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 NorMatrix Check (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 [tests_run]
DESCRIPTION:
	check the norm! in the current working directory
ARGS:
	NO		check the norm
	tests_run	run internal tests of NorMatrix

(only from source) main.py

USAGE:
	./main.py [tests_run]
DESCRIPTION:
	check the norm! in the current working directory
	(import normatrix.source.main and execute the main() func)
ARGS:
	NO		check the norm
	tests_run	run internal tests of NorMatrix

(only from source) 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

(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

[Contributor]

normatrix's People

Contributors

saverio976 avatar christophechr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.