{"id":15010660,"url":"https://github.com/immoh/nsorg-cli","last_synced_at":"2025-04-09T18:35:22.277Z","repository":{"id":62433850,"uuid":"174409582","full_name":"immoh/nsorg-cli","owner":"immoh","description":"Organize ns form using Clojure CLI","archived":false,"fork":false,"pushed_at":"2022-11-03T05:43:30.000Z","size":16,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T04:08:56.642Z","etag":null,"topics":["clojure","code-style","ns-forms"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/immoh.png","metadata":{"files":{"readme":"README.md","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":"2019-03-07T19:46:14.000Z","updated_at":"2023-07-25T14:24:13.000Z","dependencies_parsed_at":"2023-01-21T11:47:06.601Z","dependency_job_id":null,"html_url":"https://github.com/immoh/nsorg-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immoh%2Fnsorg-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immoh%2Fnsorg-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immoh%2Fnsorg-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/immoh%2Fnsorg-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/immoh","download_url":"https://codeload.github.com/immoh/nsorg-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088435,"owners_count":21045713,"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":["clojure","code-style","ns-forms"],"created_at":"2024-09-24T19:35:14.710Z","updated_at":"2025-04-09T18:35:22.258Z","avatar_url":"https://github.com/immoh.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nsorg-cli [![Build Status](https://travis-ci.org/immoh/nsorg-cli.svg?branch=master)](https://travis-ci.org/immoh/nsorg-cli)\n\nOrganize `ns` form in a way that whitespace and comments are preserved, using the [Clojure CLI](https://clojure.org/guides/deps_and_cli).\n\nRules to apply are fully customizable; the default implementation\n\n* sorts `:require`, `:require-macros`, `:use` and `:use-macros` libspecs alphabetically and removes duplicates\n* sorts `:import` class names alphabetically and removes duplicates\n* sorts `:exclude`, `:only`, `:refer`, `:refer-macros` and `:rename` options alphabetically and removes duplicates\n\nAlso available as Clojure library [nsorg](https://github.com/immoh/nsorg) \nand Leiningen plugin [lein-nsorg](https://github.com/immoh/lein-nsorg).\n\n\n## Usage\n\nYou can try it out with this one liner:\n\n```\n$ clojure -Sdeps '{:deps {nsorg-cli/nsorg-cli {:mvn/version \"0.3.1\"}}}' -m nsorg.cli\n```\n\n\nOr add it as an alias in your `deps.edn` file:\n\n```clj\n{:aliases {:nsorg {:extra-deps {nsorg-cli {:mvn/version \"0.3.1\"}}\n                   :main-opts  [\"-m\" \"nsorg.cli\"]}}}\n```\nand run it with:\n\n```\n$ clojure -Ansorg\n```\n\n\nExample output:\n```\n...\nin ./src/perf/clojure/clojure/java/perf_jdbc.clj:\n   These test compare the raw performance (against an in-memory H2 database)\n   for hand-crafted Java JDBC calls and various `query` and `reducible-query`\n   calls.\"\n-  (:require [criterium.core :as cc]\n-            [clojure.java.jdbc :as sql])\n-  (:import (java.sql Connection PreparedStatement ResultSet Statement ResultSetMetaData)))\n+  (:require [clojure.java.jdbc :as sql]\n+            [criterium.core :as cc])\n+  (:import (java.sql Connection PreparedStatement ResultSet ResultSetMetaData Statement)))\n\n (defn calibrate []\n   ;; 840ms\n...\n\nChecked 5 files, found problems in 3 files\n```\n\n### Paths\n\nPaths to check can be given as arguments:\n\n```\n$ clojure -Ansorg src dev/src\n```\n\nIf no locations are given default location is current directory.\n\n### Ignoring files\n\nYou can ignore a specific file or directory by excluding it from command-line:\n\n```\n$ clojure -Ansorg --exclude src/my-project/broken_file.clj --exclude test\n```\n\n### Apply changes automatically\n\nBy default lein-nsorg prints diffs for suggested changes. Changes can be applied automatically to source files with the\nfollowing option:\n\n```\n$ clojure -Ansorg --replace\n```\n\n### Interactive mode\n\nInstead of applying changes automatically interactive mode asks for each file if suggestions should be applied or not:\n\n```\n$ clojure -Ansorg --replace --interactive\n```\n\n## License\n\nCopyright © 2019 Immo Heikkinen\n\nDistributed under the Eclipse Public License either version 1.0 or (at your option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmoh%2Fnsorg-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimmoh%2Fnsorg-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmoh%2Fnsorg-cli/lists"}