{"id":19858621,"url":"https://github.com/greglook/cljstyle","last_synced_at":"2025-10-19T22:53:40.358Z","repository":{"id":39381257,"uuid":"78879309","full_name":"greglook/cljstyle","owner":"greglook","description":"A tool for formatting Clojure code","archived":false,"fork":false,"pushed_at":"2024-12-15T05:27:54.000Z","size":774,"stargazers_count":307,"open_issues_count":21,"forks_count":39,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-15T00:41:01.017Z","etag":null,"topics":["clojure","linter","style"],"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/greglook.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-01-13T19:23:04.000Z","updated_at":"2025-04-08T10:39:11.000Z","dependencies_parsed_at":"2024-01-04T17:46:39.736Z","dependency_job_id":"07a379cd-fc59-4dbf-8242-cfa53868e415","html_url":"https://github.com/greglook/cljstyle","commit_stats":{"total_commits":600,"total_committers":37,"mean_commits":"16.216216216216218","dds":0.675,"last_synced_commit":"9be5bb9ed678a1e73670a3df3ece08bb22362441"},"previous_names":["greglook/cljfmt"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fcljstyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fcljstyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fcljstyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fcljstyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greglook","download_url":"https://codeload.github.com/greglook/cljstyle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190396,"owners_count":22029632,"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","linter","style"],"created_at":"2024-11-12T14:24:09.083Z","updated_at":"2025-10-19T22:53:35.328Z","avatar_url":"https://github.com/greglook.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"cljstyle\n========\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/greglook/cljstyle/tree/main.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/greglook/cljstyle/tree/main)\n[![codecov](https://codecov.io/gh/greglook/cljstyle/branch/main/graph/badge.svg)](https://codecov.io/gh/greglook/cljstyle)\n[![Clojars](https://img.shields.io/clojars/v/mvxcvi/cljstyle.svg)](https://clojars.org/mvxcvi/cljstyle)\n\n`cljstyle` is a tool for formatting Clojure code. It can take something messy\nlike this:\n\n```clojure\n(  ns\n foo.bar.baz  \"some doc\"\n    (:require (foo.bar [abc :as abc]\n        def))\n    (:use foo.bar.qux)\n    (:import foo.bar.qux.Foo\n      ;; Need this for the thing\n      foo.bar.qux.Bar)\n    )\n\n(defn hello \"says hi\" (\n      [] (hello \"world\")\n  ) ([name]\n  ( println \"Hello,\" name  )\n  ))\n```\n\n...and restyle it into nicely-formatted code like this:\n\n```clojure\n(ns foo.bar.baz\n  \"some doc\"\n  (:require\n    [foo.bar.abc :as abc]\n    [foo.bar.def]\n    [foo.bar.qux :refer :all])\n  (:import\n    (foo.bar.qux\n      ;; Need this for the thing\n      Bar\n      Foo)))\n\n\n(defn hello\n  \"says hi\"\n  ([] (hello \"world\"))\n  ([name]\n   (println \"Hello,\" name)))\n```\n\nNote that this is a rewrite of the original\n[weavejester/cljfmt](https://github.com/weavejester/cljfmt/issues) tool to\nprovide more capabilities and configurability as well as a native-compiled\nbinary.\n\n\n## Installation\n\n### Manual install\nBinary releases are available on the [GitHub project](https://github.com/greglook/cljstyle/releases).\nThe native binaries are self-contained, so to install them simply place them on\nyour path.\n\n### Installation script (macOS and Linux)\n\nThis installation script works for linux and MacOS and can be used for quickly\ninstalling or upgrading to the newest cljstyle without a package manager. It\nwill install to `/usr/local/bin` by default.\n\nTo download and execute the script:\n\n```\ncurl -sLO https://raw.githubusercontent.com/greglook/cljstyle/main/util/install-cljstyle\nchmod +x install-cljstyle\n./install-cljstyle\n```\n\nThe script accepts several options to control the installation directory,\ndownload directory, version, and architecture. Run with `--help` to see all\noptions. To upgrade, just run the script again.\n\n### macOS via Homebrew\n\n`cljstyle` can be installed on macOS via a [Homebrew Cask](https://github.com/Homebrew/homebrew-cask):\n\n```bash\nbrew install --cask cljstyle\n```\n\nThe `cljstyle` binary is not code-signed, so you may also need to explicitly unquarantine it by running:\n\n```bash\nxattr -d com.apple.quarantine $(which cljstyle)\n```\n\n### Clojars\nReleases are also published to Clojars, so it can be used with any Maven-compatible\ntool. See the [integration docs](doc/integrations.md) for instructions on invoking\nfrom Leiningen and tools.deps.\n\n\n## Usage\n\nThe `cljstyle` tool supports several different commands for checking source files.\n\n### Check and Fix\n\nTo check the formatting of your source files, use:\n\n```\ncljstyle check\n```\n\nIf the formatting of any source file is incorrect, a diff will be supplied\nshowing the problem, and what cljstyle thinks it should be.\n\nIf you want to check only a specific file, or several specific files,\nyou can do that, too:\n\n```\ncljstyle check src/foo/core.clj\n```\n\nOnce you've identified formatting issues, you can choose to ignore them, fix\nthem manually, or let cljstyle fix them with:\n\n```\ncljstyle fix\n```\n\nAs with the `check` task, you can choose to fix a specific file:\n\n```\ncljstyle fix src/foo/core.clj\n```\n\nThe `pipe` command offers a generic way to correct style by reading Clojure\ncode from stdin and writing the reformatted code to stdout:\n\n```\ncljstyle pipe \u003c in.clj \u003e out.clj\n```\n\nThis command resolves configuration from the directory it is executed in, since\nthere is no explicit file path to use.\n\n### Debugging\n\nFor inspecting what cljstyle is doing, one tool is to specify the `--verbose`\nflag, which will cause additional debugging output to be printed. There are also\na few extra commands which can help understand what's happening.\n\nThe `find` command will print what files would be checked by cljstyle. It will\nprint each file path to standard output on a new line:\n\n```\ncljstyle find [path...]\n```\n\nThe `config` command will show what configuration settings cljstyle would use to\nprocess the specified files or files in the current directory:\n\n```\ncljstyle config [path]\n```\n\nFinally, `version` will show what version of the tool you're using:\n\n```\ncljstyle version\n```\n\n### Integrations\n\n`cljstyle` can be integrated into many different tools, including shells,\neditors, and tests. See the [integration docs](doc/integrations.md) for more\ndetails.\n\n\n## Configuration\n\nThe `cljstyle` tool comes with a sensible set of default configuration built-in\nand may additionally be configured by using a hierarchy of `.cljstyle` files in\nthe source tree. The [configuration settings](doc/configuration.md) include\ntoggles for format rules, width constraints, and the\n[indentation rules](doc/indentation.md).\n\n\n## Ignoring Forms\n\nBy default, cljstyle will ignore forms which are wrapped in a `(comment ...)` form\nor preceeded by the discard macro `#_`. You can also optionally disable\nformatting rules from matching a form by tagging it with `^:cljstyle/ignore`\nmetadata - this is often useful for macros.\n\n\n## License\n\nDistributed under the Eclipse Public License either version 1.0 or (at your\noption) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreglook%2Fcljstyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreglook%2Fcljstyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreglook%2Fcljstyle/lists"}