https://github.com/artichoke/clang-format
✏️ clang-format runner for CI
https://github.com/artichoke/clang-format
artichoke c ci clang-format formatter javascript linter nodejs npx
Last synced: 3 months ago
JSON representation
✏️ clang-format runner for CI
- Host: GitHub
- URL: https://github.com/artichoke/clang-format
- Owner: artichoke
- License: mit
- Created: 2020-08-12T22:08:46.000Z (almost 5 years ago)
- Default Branch: trunk
- Last Pushed: 2025-03-03T20:47:15.000Z (4 months ago)
- Last Synced: 2025-03-24T15:41:58.471Z (3 months ago)
- Topics: artichoke, c, ci, clang-format, formatter, javascript, linter, nodejs, npx
- Language: JavaScript
- Homepage: https://github.com/artichoke/clang-format#readme
- Size: 15.1 MB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Artichoke `clang-format` Runner
[](https://github.com/artichoke/clang-format/actions)
[](https://discord.gg/QCe2tp2)
[](https://twitter.com/artichokeruby)`clang-format` runner that operates recursively on a given directory and has
output suitable for use in CI and interactive development.`clang-format` does not have a pleasant way to output which files are not
properly formatted, which is not suitable for CI or code linting. Prior art to
address this limitation exists in [Sarcasm/run-clang-format].The Artichoke `clang-format` runner does not require Python or an existing
`clang` installation. This runner is simpler to distribute because it is
invokable with [`npx`].The Artichoke `clang-format` runner is used to format C sources in the
[artichoke/artichoke] repository. It will never be published to the npm
registry.## Usage
Format sources with:
```shell
npx github:artichoke/clang-format path/to/repo
```or the current directory with:
```shell
npx github:artichoke/clang-format
```This runner supports a `--check` argument which does not format sources and
instead exits with an error on bad formatting. This flag is appropriate for
running `clang-format` in CI.```shell
npx github:artichoke/clang-format --check
```## License
The Artichoke `clang-format` runner is licensed under the [MIT License](LICENSE)
(c) Ryan Lopopolo.This tool distributes pre-compiled `clang-format` binaries which part of the
LLVM Project and are subject to the [Apache 2.0 License with LLVM
exceptions][clang-format-license].[sarcasm/run-clang-format]: https://github.com/Sarcasm/run-clang-format
[`npx`]:
https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner
[artichoke/artichoke]: https://github.com/artichoke/artichoke
[clang-format-license]: https://llvm.org/LICENSE.txt