{"id":15049555,"url":"https://github.com/saverio976/normatrix","last_synced_at":"2025-10-04T10:31:12.936Z","repository":{"id":38348345,"uuid":"423284420","full_name":"Saverio976/NorMatrix","owner":"Saverio976","description":"Python Script to check the Epitech Coding Style for the C Language","archived":true,"fork":false,"pushed_at":"2022-10-31T10:30:07.000Z","size":786,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T09:10:10.396Z","etag":null,"topics":["c-language","epitech","epitech-norme","epitech-norme-checker","norminette","python","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/normatrix/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saverio976.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-31T23:35:16.000Z","updated_at":"2024-03-19T15:11:22.000Z","dependencies_parsed_at":"2023-01-19T15:15:08.899Z","dependency_job_id":null,"html_url":"https://github.com/Saverio976/NorMatrix","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saverio976%2FNorMatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saverio976%2FNorMatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saverio976%2FNorMatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saverio976%2FNorMatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saverio976","download_url":"https://codeload.github.com/Saverio976/NorMatrix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235238324,"owners_count":18958077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-language","epitech","epitech-norme","epitech-norme-checker","norminette","python","python3"],"created_at":"2024-09-24T21:21:16.122Z","updated_at":"2025-10-04T10:31:12.389Z","avatar_url":"https://github.com/Saverio976.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NorMatrix\ncheck some norm for you\n\n[![PyPI version](https://badge.fury.io/py/normatrix.svg)](https://badge.fury.io/py/normatrix)\n![python-version](https://img.shields.io/badge/python-%3E%3D3.7-green)\n\n![windows+ubuntu+macos;3.9,3.10](https://github.com/Saverio976/NorMatrix/actions/workflows/hallo_doctor.yml/badge.svg?event=push)\n[![NorMatrix Check](https://github.com/Saverio976/NorMatrix/actions/workflows/normatrix_check.yml/badge.svg)](https://github.com/Saverio976/NorMatrix/actions/workflows/normatrix_check.yml)\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/2ca7ba5d6a9e4619bd0cab7ae82ae7e1)](https://www.codacy.com/gh/Saverio976/NorMatrix/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Saverio976/NorMatrix\u0026amp;utm_campaign=Badge_Grade)\n\n![GitHub repo size](https://img.shields.io/github/repo-size/Saverio976/NorMatrix?style=plastic)\n![GitHub language count](https://img.shields.io/github/languages/count/Saverio976/NorMatrix?style=plastic)\n![GitHub top language](https://img.shields.io/github/languages/top/Saverio976/NorMatrix?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/Saverio976/NorMatrix?color=red\u0026style=plastic)\n\n# Updates\n- Project is moved to https://github.com/X-R-G-B/norma2\n- not as good as this repo for now to detect errors, but pretty good good\n- but updated with latest norm and new flag option (like explain a certain norm error (like C-01))\n\n## install\n### with pipy\n\u003cdetails\u003e\n  \u003csummary\u003eWith Pipy\u003c/summary\u003e\n\n#### 1\n- if you want some \"stable\" version:\n```bash\npip install normatrix\n```\n- if you want the most update to date version:\n```bash\npip install git+https://github.com/Saverio976/NorMatrix.git\n```\n\nNow you can use it with `python3 -m normatrix` in your terminal\n\n#### 2\nAnd if you want to just write `normatrix` :\n```bash\necho $SHELL\n```\nif you are using bash shell (the `echo` print `/something/bash`):\n```bash\necho alias normatrix=\\\"python3 -m normatrix\\\" \u003e\u003e $HOME/.bashrc\n```\nelse if you are using zsh shell (the `echo` print `/something/like/zsh`):\n```bash\necho alias normatrix=\\\"python3 -m normatrix\\\" \u003e\u003e $HOME/.zshrc\n```\nelse if you are using fish shell (the `echo` print `/something/like/fish`):\n```bash\nabbr --add 'normatrix' 'python3 -m normatrix'\n```\nelse handle this yourself bruh;\n\n#### 3\nto update it, you just have to run\n```bash\npip install -U normatrix\n```\n\n#### 4\nto uninstall it (sad), run\n```bash\npip uninstall normatrix\n```\n\u003c/details\u003e\n\n### from source\n\u003cdetails\u003e\n  \u003csummary\u003eFrom source\u003c/summary\u003e\n\n#### 1\n```bash\ngit clone https://github.com/Saverio976/NorMatrix.git\ncd NorMatrix\n```\nNow you can use it with `./path/to/folder/NorMatrix/main.py` in your terminal\n\n#### 2\nAnd if you want to just write `normatrix` :\n```bash\necho $SHELL\n```\nif you are using bash shell (the `echo` print `/something/bash`):\n```bash\necho alias normatrix=\\\"$PWD/main.py\\\" \u003e\u003e $HOME/.bashrc\n```\nelse if you are using zsh shell (the `echo` print `/something/like/zsh`):\n```bash\necho alias normatrix=\\\"$PWD/main.py\\\" \u003e\u003e $HOME/.zshrc\n```\nelse handle this yourself bruh;\n#### 3\nto update it, just go where you have cloned normatrix\nrun\n```bash\ngit pull\n```\n\n#### 4\nto uninstall it (sad)\nDelete the folder\n\u003c/details\u003e\n\n## Current Checks\n\n-   [x] 80 cols per line\n-   [x] space/tab alone (in a line)/(at the end of line)\n-   [x] two newline at end of file\n-   [x] two newline between function (between all buf chhhtt)\n-   [x] libc function call (pr welcome to add some libc function always banned)\n-   [x] nested branch more than 3 branch\n-   [x] no more than 20 lines per function\n-   [x] comma with no space after\n-   [x] end of parenthesis with a open curly bracket next `){`\n-   [x] star char `*` like this `char* buf`\n-   [x] preprocessors indentations (`#if..`, `#endif`)\n-   [x] multiple statements\n-   [x] 5 functions per file\n-   [x] filename of source code only snake\\_case\n-   [x] no line break at end of file\n-   [x] 5+5 7/9 that need a space (but some false positiv goes in)\n-   [x] no space after [ and space  before ]\n-   [x] header\n-   [x] #define in .c\n-   [x] make + check exe if the compiler add some banned function\n-   [ ] ...\n\n## doc\n### (if you use pipy) python -m normatrix\n\u003cdetails\u003e\n  \u003csummary\u003e(if you use pipy) python -m normatrix\u003c/summary\u003e\n\n```bash\nusage: python -m normatrix [-h] [--no-operators-pluggin] [--preview] [--conf] [--only-errors] [--no-fclean] [--link-line] [--tests-run]\n                           [--output format]\n                           [paths ...]\n\nThe C Epitech Coding Style Norm Checker\n\npositional arguments:\n  paths                 list of path to check (default: the current working directory)\n\noptions:\n  -h, --help            show this help message and exit\n  --no-operators-pluggin\n                        remove the operators pluggin (because it print some false positiv for now)\n  --preview             add some plugin that are added recently\n  --conf                [deprecated][now it check always for the file] tells if you have a .normatrix config file\n  --only-errors         print only bad files with errors\n  --no-fclean           if you want normatrix dont do a \"make fclean\" at the end\n  --link-line           to have the \"link\" to the file (in vscode terminal you can click it and it will open the file at the line of the error)\n  --tests-run           run the unit tests for normatrix\n  --output format       tell which output format to use [html, md, term_color, term_rich]; for html the file is normatrix-result.htlm; for md the\n                        file is normatrix-result.md\n```\n\u003c/details\u003e\n\n### (only from source) main.py\n\u003cdetails\u003e\n  \u003csummary\u003e(only from source) main.py\u003c/summary\u003e\n\n```bash\nusage: ./main.py [-h] [--no-operators-pluggin] [--preview] [--conf] [--only-errors] [--no-fclean] [--link-line] [--tests-run]\n                           [--output format]\n                           [paths ...]\n\nThe C Epitech Coding Style Norm Checker\n\npositional arguments:\n  paths                 list of path to check (default: the current working directory)\n\noptions:\n  -h, --help            show this help message and exit\n  --no-operators-pluggin\n                        remove the operators pluggin (because it print some false positiv for now)\n  --preview             add some plugin that are added recently\n  --conf                [deprecated][now it check always for the file] tells if you have a .normatrix config file\n  --only-errors         print only bad files with errors\n  --no-fclean           if you want normatrix dont do a \"make fclean\" at the end\n  --link-line           to have the \"link\" to the file (in vscode terminal you can click it and it will open the file at the line of the error)\n  --tests-run           run the unit tests for normatrix\n  --output format       tell which output format to use [html, md, term_color, term_rich]; for html the file is normatrix-result.htlm; for md the\n                        file is normatrix-result.md\n```\n\u003c/details\u003e\n\n### (only from source) exec.sh\n\u003cdetails\u003e\n  \u003csummary\u003e(only from source) exec.sh\u003c/summary\u003e\n\n(this file exists only to keep compatibility to older version)\n```bash\nusage: ./main.py [-h] [--no-operators-pluggin] [--preview] [--conf] [--only-errors] [--no-fclean] [--link-line] [--tests-run]\n                           [--output format]\n                           [paths ...]\n\nThe C Epitech Coding Style Norm Checker\n\npositional arguments:\n  paths                 list of path to check (default: the current working directory)\n\noptions:\n  -h, --help            show this help message and exit\n  --no-operators-pluggin\n                        remove the operators pluggin (because it print some false positiv for now)\n  --preview             add some plugin that are added recently\n  --conf                [deprecated][now it check always for the file] tells if you have a .normatrix config file\n  --only-errors         print only bad files with errors\n  --no-fclean           if you want normatrix dont do a \"make fclean\" at the end\n  --link-line           to have the \"link\" to the file (in vscode terminal you can click it and it will open the file at the line of the error)\n  --tests-run           run the unit tests for normatrix\n  --output format       tell which output format to use [html, md, term_color, term_rich]; for html the file is normatrix-result.htlm; for md the\n                        file is normatrix-result.md\n```\n\u003c/details\u003e\n\n### (only from source) Makefile\n\u003cdetails\u003e\n  \u003csummary\u003e(only from source) Makefile (deprecated)\u003c/summary\u003e\n\n(this file exists only to keep compatibility to older version)\n(if you can, move to another choice)\n```bash\nUSAGE:\n    make -C path/to/NorMatrix PATH_CHECK=$PWD\nDESCRIPTION:\n    check the norm! in the current working directory\n    (call main.py)\nARGS:\n    -C path/to/NorMatrix    run the makefile that is in path/to/NorMatrix\n                            instead of the one where you are\n\n    PATH_CHECK=$PWD\t        check the norm in your current working\n                            directory\n```\n\u003c/details\u003e\n\n### configuration\nyou can now configure what functions are banned, and what are not,\nyou can now configure what extension file are banned, and what are not,\n\nall you have to do is put a file `.normatrix.json` where you execute `normatrix`\n\nexample with nothing banned and no preview (preview = not stable check) check\n`.normatrix.json`\n```json\n{\n    \"banned\": [],\n    \"no-banned\": [],\n    \"extension\": [],\n    \"no-extension\": [],\n    \"enable-preview\": false\n}\n```\n\njust add inside `[]` the string of what you want\n\n**other explanation with example**\n\n\u003cdetails\u003e\n  \u003csummary\u003eother explanation with example\u003c/summary\u003e\n\n- to no-banne memset (because you can use it)\n```json\n{\n    \"no-banned\": [\"memset\"]\n}\n```\n- to ban my_printf (because you dont want to use it)\n```json\n{\n    \"banned\": [\"my_printf\"]\n}\n```\n- to no-banne \\*.o file (because you dont need this warning)\n```json\n{\n    \"no-extension\": [\"*.o\"]\n}\n```\n- to banne \\*.c file (because you want c file banned)\n```json\n{\n    \"extension\": [\"*.c\"]\n}\n```\n- to enable preview check by default\n```json\n{\n    \"enable-preview\": true\n}\n```\n\u003c/details\u003e\n\nby default there are somthing like this:\n```json\n{\n    \"banned\": [\"printf\", \"memset\", \"strcpy\", \"strcat\", \"calloc\"],\n    \"no-banned\": [],\n    \"extension\": [\"*.a\", \"*.o\", \"*.so\", \".gch\", \"*~\", \"*#\", \"*.d\"],\n    \"no-extension\": [],\n    \"enable-preview\": false\n}\n```\nthis configuration will be added even if you add a `.normatrix.json` file\n\nbut if you want to remove `*.o`, just add it to the `no-extension`\n\nor you can put `*.o` in a `.gitignore`\n\nit will remove it from the default\n\n## Run as a **github workflow**\n\nthis is not the latest normatrix but :\n\nlink : [link](https://github.com/Saverio976/NorMatrix/runs/6242624947?check_suite_focus=true)\n\n![example](/assets/example_normatrix.png)\n![example1](/assets/example_normatrix_1.png)\n\nstate : [![NorMatrix Check](https://github.com/Saverio976/NorMatrix/actions/workflows/normatrix_check.yml/badge.svg)](https://github.com/Saverio976/NorMatrix/actions/workflows/normatrix_check.yml)\n\n(N.B. : this workflow pass well, but it will not if you copy the code below)\n\n1. **in the repo root :**\n```bash\nmkdir .github\nmkdir .github/workflows\necho '\nname: NorMatrix Check\n\non: [push]\n\njobs:\n  norm:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2\n\n    - name: set up python\n      uses: actions/setup-python@v2\n      with:\n        python-version: '3.9'\n\n    - name: clone NorMatrix\n      run: pip install git+https://github.com/Saverio976/NorMatrix.git\n\n    - name: NorMatrix\n      run: python3 -m normatrix --only-errors\n' \u003e .github/workflows/normatrix_check.yml\n```\n2. **you can push the modification to github**\n\n## Contribute\n***[more information on [CONTRIBUTNG.md](https://github.com/Saverio976/NorMatrix/blob/main/CONTRIBUTING.md)]***\n\n## Alternatives\n\n- [crNormz](https://github.com/CustomEntity/crNormz)\n- [Abricot-Norminette](https://github.com/Just1truc/Abricot-Norminette)\n- [jankun_norme](https://github.com/LeoSarochar/jankun_norme)\n- [Bubulle-Norminette](https://github.com/aureliancnx/Bubulle-Norminette)\n- [NormEZ](https://github.com/ronanboiteau/NormEZ)\n\n## Thanks\n-    chempa for his sample of file that dont follow the epitech norm\n-    and invisble testers that says **\"bha baah normatrix have a bug\"**\n\n## Contributors\n\u003chtml\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd align=\"center\"\u003e\u003ca href=https://github.com/Saverio976\u003e\u003cimg src=https://avatars.githubusercontent.com/u/57769503?v=4 width=\"50;\" alt=Xavier Mitault/\u003e\u003cbr /\u003e\u003csub style=\"font-size:14px\"\u003e\u003cb\u003eXavier Mitault\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=https://github.com/apps/github-actions\u003e\u003cimg src=https://avatars.githubusercontent.com/in/15368?v=4 width=\"50;\" alt=apps/github-actions/\u003e\u003cbr /\u003e\u003csub style=\"font-size:14px\"\u003e\u003cb\u003eapps/github-actions\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=https://github.com/TristanMasselot\u003e\u003cimg src=https://avatars.githubusercontent.com/u/91824914?v=4 width=\"50;\" alt=Mizu/\u003e\u003cbr /\u003e\u003csub style=\"font-size:14px\"\u003e\u003cb\u003eMizu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=https://github.com/romainpanno\u003e\u003cimg src=https://avatars.githubusercontent.com/u/91630499?v=4 width=\"50;\" alt=mE0w/\u003e\u003cbr /\u003e\u003csub style=\"font-size:14px\"\u003e\u003cb\u003emE0w\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=https://github.com/christophechr\u003e\u003cimg src=https://avatars.githubusercontent.com/u/91553820?v=4 width=\"50;\" alt=Christophe CHHOR/\u003e\u003cbr /\u003e\u003csub style=\"font-size:14px\"\u003e\u003cb\u003eChristophe CHHOR\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\u003c/html\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaverio976%2Fnormatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaverio976%2Fnormatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaverio976%2Fnormatrix/lists"}