{"id":17948614,"url":"https://github.com/baschni/21norm","last_synced_at":"2026-05-02T19:33:34.470Z","repository":{"id":259404549,"uuid":"877779271","full_name":"baschni/21norm","owner":"baschni","description":"reformats C code and header files, to get closer to the norm of the 42 schools","archived":false,"fork":false,"pushed_at":"2025-02-25T18:50:10.000Z","size":365,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T15:32:55.436Z","etag":null,"topics":["42","c","norminette"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baschni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-24T08:22:12.000Z","updated_at":"2025-02-25T18:50:14.000Z","dependencies_parsed_at":"2024-10-25T05:18:26.377Z","dependency_job_id":"f7ade26e-2d80-4690-9844-3ee5b60bfaa7","html_url":"https://github.com/baschni/21norm","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"b881228e54b7ca8ec9a052e08e4f550f048d2e7f"},"previous_names":["baschni/21norm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/baschni/21norm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baschni%2F21norm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baschni%2F21norm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baschni%2F21norm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baschni%2F21norm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baschni","download_url":"https://codeload.github.com/baschni/21norm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baschni%2F21norm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32547647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["42","c","norminette"],"created_at":"2024-10-29T09:07:44.633Z","updated_at":"2026-05-02T19:33:34.404Z","avatar_url":"https://github.com/baschni.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"21norm\n=======\n\n[21norm](http://github.com/baschni/21norm) is a python script which tries to automatically resolve many norm errors issued by [norminette](https://github.com/42School/norminette)\n\n## Motivation\n\nWhen you are studying at 42 you know: once you finished a project you have to correct all norm errors before submitting. This can be quite tedious if you have many files and is it not kind of a stupid thing to go through all the files, replace spaces by tabs or vice versa, remove consecutive newlines and so on?\n21norm will try to easen that burden by loading the files, checking for norm errors, and correcting them (if it can).\n\nIt cannot correct the most beautiful norm errors:\n1. Line too long\n2. too many lines in function\n3. too many functions in file\n\n## Warning\n\n[21norm](http://github.com/baschni/21norm) is experimental. It will overwrite your files. There is a chance that it makes changes that will break your code or might even lead to data loss.\nI firmly recommend to make a `git add .`, `git commit -m` and `git push` before you run it, so you can return to your old files in case of data loss.\n\n## Usage\n\nType `21norm` to norm all *.c and *.h files in the current directory. Type `21norm specific_folder/specific_file.c` to norm just that file.\n\n## Installation\n\n### Requirements\n\nnorminette must be installed and in the path.\n\n### Download \u0026 Configuration\n\nClone the git repository [21norm](http://github.com/baschni/21norm) to a folder, e.g. `/home/\u003cuser\u003e/programs/21norm`. In the downloaded folder, edit config.py to change `USER` and `EMAIL` to your username and email, which will be shown in the 42 header.\n\n### Create a symlink\n\nGoto `/home/\u003cuser\u003e/bin`, create a symbolic link to the file `21norm.py` in the download folder and make it executable:\n\n```\ncd /home/\u003cuser\u003e/bin\nln -s /home/\u003cuser\u003e/programs/21norm/21norm.py ./21norm\nchmod 0100 ./21norm\n```\n\nYou can now execute `21norm` in your shell. If not, or if the directory `/home/\u003cuser\u003e/bin` should not exist, see the [section below](#put-bin-to-path).\n\n### Put ~/bin to $PATH\n\nIf there is no folder `/home/\u003cuser\u003e/bin` create it:\n```\nmkdir ~/bin`\n```\nCheck if it is  in the $PATH variable:\n```\necho $PATH\n```\nIf not, you can add `export PATH=/home/\u003cuser\u003e/bin` to your `~/.zshrc` (or `~/.bashrc` if you are using bash) or to `~/.profile`, regarding your system/needs.\n\n### Add a shortcut for VS Code\n\nOpen the file where you can edit the keyboard shortcuts via `File -\u003e Preferences -\u003e Keyboard Shortcuts` and click on the file icon in the upper right corner:\n\n![Button to open Keyboard Shorcuts file in VS Code](README/VSCode_Edit_Keyboard_Shortcuts_File.png)\n\nAdd the following code at the top. You can also modify the shortcut to your needs (here I chose `CTRL + N`):\n```\n{\n\t\"key\": \"ctrl+shift+n\",\n\t\"command\": \"workbench.action.terminal.sendSequence\",\n\t\"args\": {\n\t\t\"text\": \"VSCODE_WD=$(sed 's/\\\\\\\\/\\\\//g' \u003c\u003c\u003c '${fileDirname}' | sed 's/C:/\\\\/mnt\\\\/c/g') \u0026\u0026 cd \\\"$VSCODE_WD\\\" \u0026\u0026 echo \\\"cd $VSCODE_WD\\\"\\n21norm \\\"${fileBasename}\\\"\\n\"\n\t}\n},\n```\nAfter pressing the shorcut, it should activate the latest open terminal, change to the directory where currently opened file resides and run `42check` on it.\n\nIf you use VS Code on Windows with WSL (Windows Subsystem for Linux), try this little hack:\n```\n{\n\t\"key\": \"ctrl+n\",\n\t\"command\": \"workbench.action.terminal.sendSequence\",\n\t\"args\": {\n\t\t\"text\": \"VSCODE_WD=`sed 's/\\\\\\\\\\\\\\\\/\\\\//g' \u003c\u003c\u003c '${fileDirname}' | sed 's/C:/\\\\/mnt\\\\/c/g'` cd \\\"$VSCODE_WD\\\" \u0026\u0026 echo \\\"cd $VSCODE_WD\\\"\\n42checker \\\"${fileBasename}\\\"\\n\"\n\t}\n},\n```\n\n## Doxygen Comments\n[21norm](http://github.com/baschni/21norm) will recognize Doxygen Comments in the following format and will try to wrap lines longer than 80 spaces:\n```\n/**\n * @brief sort the items on stack_a using stack_b\n * \n * The idea of double sort is to separate all items into two groups in stack_a\n * and stack_b (push_half_to_b) which are then put in order concurrently\n * (stack_a sorted increasingly, stack_b sorted decreasingly) and finally\n * joined, in order, on stack_a (push_back_to_a). There are to options to\n * proceed: either push the smallest elements of stack_a to stack_b or the\n * largest elements. Both variants are tested (op1 and op2 respectively) and are\n * compared. The variant with the smallest number of oper- ations is returend.\n * \n * @param stack_a stack configuration to bring in order\n * @return t_ring* list of operations to sort stack_a using stack_b\n*/\n```\n\n## See also\n\nIf you like [21norm](http://github.com/baschni/21norm), you might also like [42check](http://github.com/baschni/42check), which will reformat the output of [norminette](https://github.com/42School/norminette) to make links with line and column numbers work in VS Code.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaschni%2F21norm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaschni%2F21norm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaschni%2F21norm/lists"}