Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
24 changes: 18 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,27 @@ jobs:
name: asdf plugin test
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
os: [ubuntu-latest, macos-latest]
plugin:
- clang-format
- clang-tidy
- clang-query
- clang-apply-replacements
include:
- plugin: clang-format
command: clang-format --version
- plugin: clang-tidy
command: clang-tidy --version
- plugin: clang-query
command: clang-query --version
- plugin: clang-apply-replacements
command: clang-apply-replacements --version
runs-on: ${{ matrix.os }}
steps:
- name: asdf_plugin_test
- name: Test ${{ matrix.plugin }}
uses: asdf-vm/actions/plugin-test@v1
env:
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE: 1
with:
plugin: clang-format
command: clang-format --version
plugin: ${{ matrix.plugin }}
command: ${{ matrix.command }}
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
- name: Run shfmt
run: scripts/shfmt.bash

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-yaml
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

MIT License

Copyright (c) [year] [fullname]
Copyright (c) 2025 cpp-linter team
Copyright (c) 2021 Andy Mroczkowski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 17 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div align="center">

# asdf-clang-tools [![Build](https://github.com/amrox/asdf-clang-tools/actions/workflows/build.yml/badge.svg)](https://github.com/amrox/asdf-clang-tools/actions/workflows/build.yml) [![Lint](https://github.com/amrox/asdf-clang-tools/actions/workflows/lint.yml/badge.svg)](https://github.com/amrox/asdf-clang-tools/actions/workflows/lint.yml)
# asdf-clang-tools [![Build](https://github.com/cpp-linter/asdf-clang-tools/actions/workflows/build.yml/badge.svg)](https://github.com/cpp-linter/asdf-clang-tools/actions/workflows/build.yml) [![Lint](https://github.com/cpp-linter/asdf-clang-tools/actions/workflows/lint.yml/badge.svg)](https://github.com/cpp-linter/asdf-clang-tools/actions/workflows/lint.yml)


[clang-tools](https://github.com/muttleyxd/clang-tools-static-binaries) plugin for the [asdf version manager](https://asdf-vm.com).
[clang-tools](https://github.com/cpp-linter/asdf-clang-tools) plugin for the [asdf version manager](https://asdf-vm.com).

</div>

Expand All @@ -12,14 +11,15 @@
This is an asdf plugin for installing several clang tools:

- clang-format
- clang-query
- clang-tidy
- clang-query
- clang-apply-replacements

This plugin uses the pre-compiled binaries from the very handy [muttleyxd/clang-tools-static-binaries](https://github.com/muttleyxd/clang-tools-static-binaries) repo.
This plugin uses the pre-compiled binaries from the very handy [cpp-linter/clang-tools-static-binaries](https://github.com/cpp-linter/clang-tools-static-binaries) repo.

## Caveats

- Again, the source for these binaries is currently [muttleyxd/clang-tools-static-binaries](https://github.com/muttleyxd/clang-tools-static-binaries). Please make sure you trust that repository.
- Again, the source for these binaries is currently [cpp-linter/clang-tools-static-binaries](https://github.com/cpp-linter/clang-tools-static-binaries). Please make sure you trust that repository.
- Only Intel (`x86_64`/`amd64`) binaries are currently provided.
- These binaries do work on macOS with Apple Silicon, but they will run under Rosetta.
- Signed binaries are not provided for macOS. This plugin will offer to de-quarantine the binaries for you, but please make sure you understand the consequences.
Expand All @@ -31,32 +31,32 @@ This plugin uses the pre-compiled binaries from the very handy [muttleyxd/clang-

# Install

This plugin supports multiple tools (similar to [asdf-hashicorp](https://github.com/asdf-community/asdf-hashicorp) and [asdf-pyapp](https://github.com/amrox/asdf-pyapp).
Plugin:

| Tool | Command to add Plugin |
| ------------ | ---------------------------------------------------------------------------- |
| clang-format | `asdf plugin add clang-format https://github.com/amrox/asdf-clang-tools.git` |
| clang-query | `asdf plugin add clang-query https://github.com/amrox/asdf-clang-tools.git` |
| clang-tidy | `asdf plugin add clang-tidy https://github.com/amrox/asdf-clang-tools.git` |

| clang-format | `asdf plugin add clang-format https://github.com/cpp-linter/asdf-clang-tools.git` |
| clang-query | `asdf plugin add clang-query https://github.com/cpp-linter/asdf-clang-tools.git` |
| clang-tidy | `asdf plugin add clang-tidy https://github.com/cpp-linter/asdf-clang-tools.git` |
| clang-apply-replacements | `asdf plugin add clang-apply-replacements https://github.com/cpp-linter/asdf-clang-tools.git` |

Example:

```shell
asdf plugin add clang-format https://github.com/amrox/asdf-clang-tools.git
asdf plugin add clang-format https://github.com/cpp-linter/asdf-clang-tools.git
```

clang-format:

```shell
# Show all installable versions
asdf list-all clang-format
asdf list all clang-format

# Install specific version
asdf install clang-format latest

# Set a version globally (on your ~/.tool-versions file)
asdf global clang-format latest
# Set a version (on your ~/.tool-versions file)
asdf set clang-format latest

# Now clang-tools commands are available
clang-format
Expand All @@ -70,18 +70,12 @@ install & manage versions.
## Environment Variables

- `ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE`: set to "1" to automatically de-quarantine binaries. Otherwise, it will interactively ask to do so.
- `ASDF_CLANG_TOOLS_LINUX_IGNORE_ARCH`: set to "1" to install the `amd64` binary regardless of the host architecture. The [clang-tools](https://github.com/muttleyxd/clang-tools-static-binaries) project does not currently provide `arm64`/`aarch64` Linux binaries. This assumes that you have set up [QEMU User Emulation](https://wiki.debian.org/QemuUserEmulation) (or similar) to run foreign binaries under emulation.

# Acknowledgements

Thank you to the authors and contributors to [muttleyxd/clang-tools-static-binaries](https://github.com/muttleyxd/clang-tools-static-binaries).
- `ASDF_CLANG_TOOLS_LINUX_IGNORE_ARCH`: set to "1" to install the `amd64` binary regardless of the host architecture. The [clang-tools](https://github.com/cpp-linter/clang-tools-static-binaries) project does not currently provide `arm64`/`aarch64` Linux binaries. This assumes that you have set up [QEMU User Emulation](https://wiki.debian.org/QemuUserEmulation) (or similar) to run foreign binaries under emulation.

# Contributing

Contributions of any kind welcome! See the [contributing guide](contributing.md).

[Thanks goes to these contributors](https://github.com/amrox/asdf-clang-tools/graphs/contributors)!

# License

See [LICENSE](LICENSE) © [Andy Mroczkowski](https://github.com/amrox/)
See [LICENSE](LICENSE)
2 changes: 1 addition & 1 deletion bin/help.overview
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

echo "asdf plugin for clang tools - clang-format, clang-tidy, clang-query"
echo "asdf plugin for clang tools - clang-format, clang-tidy, clang-query, clang-apply-replacements, and more"
2 changes: 1 addition & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Testing Locally:
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]

#
asdf plugin test clang-tools https://github.com/amrox/asdf-clang-tools.git "clang-format"
asdf plugin test clang-tools https://github.com/cpp-linter/asdf-clang-tools.git "clang-format"
```

Tests are automatically run in GitHub Actions on push and PR.
2 changes: 1 addition & 1 deletion lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -euo pipefail
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE=${ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE:-0}
ASDF_CLANG_TOOLS_LINUX_IGNORE_ARCH=${ASDF_CLANG_TOOLS_LINUX_IGNORE_ARCH:-0}

GH_REPO="muttleyxd/clang-tools-static-binaries"
GH_REPO="cpp-linter/clang-tools-static-binaries"
PLUGIN_NAME="clang-tools"
USE_KERNEL=
USE_ARCH=
Expand Down
Loading