Skip to content

Commit b18b97d

Browse files
authored
fix: update scripts to make it work (#1)
* fix: update scripts to make it work * feat: add pre-commit-config.yaml * test all plugins
1 parent fb7621b commit b18b97d

File tree

9 files changed

+64
-33
lines changed

9 files changed

+64
-33
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
actions:
9+
patterns:
10+
- "*"

.github/workflows/build.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,27 @@ jobs:
1111
name: asdf plugin test
1212
strategy:
1313
matrix:
14-
os:
15-
- ubuntu-latest
16-
- macos-latest
14+
os: [ubuntu-latest, macos-latest]
15+
plugin:
16+
- clang-format
17+
- clang-tidy
18+
- clang-query
19+
- clang-apply-replacements
20+
include:
21+
- plugin: clang-format
22+
command: clang-format --version
23+
- plugin: clang-tidy
24+
command: clang-tidy --version
25+
- plugin: clang-query
26+
command: clang-query --version
27+
- plugin: clang-apply-replacements
28+
command: clang-apply-replacements --version
1729
runs-on: ${{ matrix.os }}
1830
steps:
19-
- name: asdf_plugin_test
31+
- name: Test ${{ matrix.plugin }}
2032
uses: asdf-vm/actions/plugin-test@v1
2133
env:
2234
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE: 1
2335
with:
24-
plugin: clang-format
25-
command: clang-format --version
36+
plugin: ${{ matrix.plugin }}
37+
command: ${{ matrix.command }}

.github/workflows/lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ jobs:
3434
- name: Run shfmt
3535
run: scripts/shfmt.bash
3636

37+
- name: Run pre-commit hooks
38+
uses: pre-commit/action@v3.0.0
39+
with:
40+
extra_args: --all-files
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-added-large-files
8+
- id: check-yaml

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
MIT License
33

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

67
Permission is hereby granted, free of charge, to any person obtaining a copy
78
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<div align="center">
22

3-
# 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)
3+
# 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)
44

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

87
</div>
98

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

1413
- clang-format
15-
- clang-query
1614
- clang-tidy
15+
- clang-query
16+
- clang-apply-replacements
1717

18-
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.
18+
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.
1919

2020
## Caveats
2121

22-
- 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.
22+
- 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.
2323
- Only Intel (`x86_64`/`amd64`) binaries are currently provided.
2424
- These binaries do work on macOS with Apple Silicon, but they will run under Rosetta.
2525
- 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.
@@ -31,32 +31,32 @@ This plugin uses the pre-compiled binaries from the very handy [muttleyxd/clang-
3131

3232
# Install
3333

34-
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).
34+
Plugin:
3535

3636
| Tool | Command to add Plugin |
3737
| ------------ | ---------------------------------------------------------------------------- |
38-
| clang-format | `asdf plugin add clang-format https://github.com/amrox/asdf-clang-tools.git` |
39-
| clang-query | `asdf plugin add clang-query https://github.com/amrox/asdf-clang-tools.git` |
40-
| clang-tidy | `asdf plugin add clang-tidy https://github.com/amrox/asdf-clang-tools.git` |
41-
38+
| clang-format | `asdf plugin add clang-format https://github.com/cpp-linter/asdf-clang-tools.git` |
39+
| clang-query | `asdf plugin add clang-query https://github.com/cpp-linter/asdf-clang-tools.git` |
40+
| clang-tidy | `asdf plugin add clang-tidy https://github.com/cpp-linter/asdf-clang-tools.git` |
41+
| clang-apply-replacements | `asdf plugin add clang-apply-replacements https://github.com/cpp-linter/asdf-clang-tools.git` |
4242

4343
Example:
4444

4545
```shell
46-
asdf plugin add clang-format https://github.com/amrox/asdf-clang-tools.git
46+
asdf plugin add clang-format https://github.com/cpp-linter/asdf-clang-tools.git
4747
```
4848

4949
clang-format:
5050

5151
```shell
5252
# Show all installable versions
53-
asdf list-all clang-format
53+
asdf list all clang-format
5454

5555
# Install specific version
5656
asdf install clang-format latest
5757

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

6161
# Now clang-tools commands are available
6262
clang-format
@@ -70,18 +70,12 @@ install & manage versions.
7070
## Environment Variables
7171

7272
- `ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE`: set to "1" to automatically de-quarantine binaries. Otherwise, it will interactively ask to do so.
73-
- `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.
74-
75-
# Acknowledgements
76-
77-
Thank you to the authors and contributors to [muttleyxd/clang-tools-static-binaries](https://github.com/muttleyxd/clang-tools-static-binaries).
73+
- `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.
7874

7975
# Contributing
8076

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

83-
[Thanks goes to these contributors](https://github.com/amrox/asdf-clang-tools/graphs/contributors)!
84-
8579
# License
8680

87-
See [LICENSE](LICENSE) © [Andy Mroczkowski](https://github.com/amrox/)
81+
See [LICENSE](LICENSE)

bin/help.overview

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
echo "asdf plugin for clang tools - clang-format, clang-tidy, clang-query"
3+
echo "asdf plugin for clang tools - clang-format, clang-tidy, clang-query, clang-apply-replacements, and more"

contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Testing Locally:
66
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]
77

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

1212
Tests are automatically run in GitHub Actions on push and PR.

lib/utils.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -euo pipefail
66
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE=${ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE:-0}
77
ASDF_CLANG_TOOLS_LINUX_IGNORE_ARCH=${ASDF_CLANG_TOOLS_LINUX_IGNORE_ARCH:-0}
88

9-
GH_REPO="muttleyxd/clang-tools-static-binaries"
9+
GH_REPO="cpp-linter/clang-tools-static-binaries"
1010
PLUGIN_NAME="clang-tools"
1111
USE_KERNEL=
1212
USE_ARCH=

0 commit comments

Comments
 (0)