{"id":305380,"url":"https://github.com/FedericoCeratto/nimfmt","last_synced_at":"2025-07-16T20:31:40.020Z","repository":{"id":39717617,"uuid":"76906972","full_name":"FedericoCeratto/nimfmt","owner":"FedericoCeratto","description":"Nim code formatter / linter / style checker","archived":true,"fork":false,"pushed_at":"2021-12-29T13:09:08.000Z","size":30,"stargazers_count":85,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-07T11:30:48.208Z","etag":null,"topics":["linter","nim","nim-lang","nimfmt"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FedericoCeratto.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-19T23:58:03.000Z","updated_at":"2024-10-05T15:22:53.000Z","dependencies_parsed_at":"2022-09-20T09:25:31.890Z","dependency_job_id":null,"html_url":"https://github.com/FedericoCeratto/nimfmt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnimfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnimfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnimfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnimfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FedericoCeratto","download_url":"https://codeload.github.com/FedericoCeratto/nimfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226168097,"owners_count":17584276,"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":["linter","nim","nim-lang","nimfmt"],"created_at":"2024-01-07T07:56:46.337Z","updated_at":"2024-11-24T13:30:22.379Z","avatar_url":"https://github.com/FedericoCeratto.png","language":"Nim","funding_links":[],"categories":["Programming Languages"],"sub_categories":[],"readme":"=== Nim code formatter / style checker\n\n.Features\n* [x] Detect inconsistent variable and proc naming\n* [x] Fix inconsistent variable and proc naming\n* [x] Add/remove whitespaces and commas in function calls\n* [ ] Sort imports\n* [ ] Enforce variable/function naming style\n* Enforce whitelines (in fixed number or a range):\n** [ ] before functions\n** [ ] on closing blocks\n** [ ] end of file\n** [ ] around imports\n* [ ] Optional # to close blocks\n\nOne of the main features is to detect and correct inconsistent variable and function naming.\n\nUsing proc_naming_style = most_popular, if the same identifier appears within a file as `myName` more frequently and `my_name` and `myname` less frequently, nimfmt will pick the first one. This is the recommended setting to ensure consistency without having to explicitly configure nimfmt with a preferred style.\n\nUsing proc_naming_style = snake_case, if the same identifier appears as `myName`, `my_name` and `myname`, nimfmt will pick the second one.\n\n==== Configuration\n\n.nimfmt looks for configuration files is the following order:\n* current directory\n* ~/.config/nimfmt.cfg\n* ~/.nimfmt.cfg\n* /etc/nimfmt.cfg\n\nConfiguration example:\n[source,nim]\n----\n# Fix inconsistent naming\n# auto     - fix automatically\n# no       - print warning only\nfix_naming_style = \"auto\"\n\n# Choose the correct naming\n# most_popular  - pick the most frequently used naming style for a given identifier\n# snake_case    - prefer snake_case naming if possible\nproc_naming_style = most_popular\n----\n\n==== Examples\n\nInput:\n[source,nim]\n----\nproc my_foo( a: string,  b:string,c:int, ): string  =\n  raise newException ( Exception ,\n    \"foo\" )\n  foo ( a , b , c )\n  d [ a ]  =  3\n  discard    \"string to discard\"\n\n  break\n  return   \"string to return\"\n\n----\n\nOutput:\n[source,nim]\n----\nproc my_foo(a: string; b: string; c: int): string =\n  raise newException(Exception, \"foo\")\n  foo(a, b, c)\n  d[a] = 3\n  discard \"string to discard\"\n  break\n  return \"string to return\"\n----\n\n==== Usage\n\n[source,bash]\n----\n  nimfmt \u003cfilename.nim\u003e [\u003cfilename.nim\u003e ... ]\n  [ -p \u003cprefix\u003e ]     output file prefix\n  [ -s \u003csuffix\u003e ]     output file suffix\n  [ -c \u003cfilename\u003e, ]  configuration file location(s) (default: ./.nimfmt.cfg ~/.nimfmt.cfg)\n  [ -i ]              update files in-place (dangerous!)\n  [ -w ]              overwrite existing files (automatically enabled when using -i)\n  [-v]                version\n  [-h]                this help\n\n  If any of -p ..., -s ... or -i are specified the output will be written to disk,\n  otherwise to stdout\n----\n\n==== Installation\n\n[source,bash]\n----\nnimble install https://github.com/FedericoCeratto/nimfmt\n----\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFedericoCeratto%2Fnimfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFedericoCeratto%2Fnimfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFedericoCeratto%2Fnimfmt/lists"}