Skip to content

Commit 5de59b7

Browse files
authored
docs: Various README and doc fixes (#193)
- incorrect CI workflow names - clarifications on compatibility guarantees - nicer formatting for warnings - version reference updates - search link update - links to regex101 example
1 parent 2c05b47 commit 5de59b7

3 files changed

Lines changed: 28 additions & 19 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Testing your contribution:
22

3-
The GitHub Actions [Test workflow](https://github.com/jidicula/clang-format-action/actions/workflows/test.yml) is triggered on PR submission. It runs [`test/test.sh`](https://github.com/jidicula/clang-format-action/blob/main/test/test.sh) on the [test files](https://github.com/jidicula/clang-format-action/tree/main/test). Run this script locally to test your changes. If you're adding checking functionality for new file extensions, add test files that are known to pass this Action's check and known to fail this Action's check, in `test/known_pass` and `test/known_fail` respectively.
3+
The GitHub Actions [Tests workflow](https://github.com/jidicula/clang-format-action/actions/workflows/tests.yml) is triggered on PR submission. It runs [`test/test.sh`](https://github.com/jidicula/clang-format-action/blob/main/test/test.sh) on the [test files](https://github.com/jidicula/clang-format-action/tree/main/test). Run this script locally to test your changes. If you're adding checking functionality for new file extensions, add test files that are known to pass this action's check and known to fail this action's check, in `test/known_pass` and `test/known_fail` respectively.

README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55

66
# clang-format-action
7-
GitHub Action for `clang-format` checks. Note that this Action does **NOT** format your code for you - it only verifies that your repository's code follows your project's formatting conventions.
7+
An action for `clang-format` checks. This action does **NOT** format your code for you - it only verifies that your repository's code follows your project's formatting conventions.
88

9-
You can define your own formatting rules in a `.clang-format` file at your repository root, or you can provide a fallback style (see [`fallback-style`](#inputs)). You can also provide a path to check. If you want to run checks against multiple paths in your repository, you can use this Action in a [matrix run](#multiple-paths).
9+
You can define your own formatting rules in a `.clang-format` file at your repository root, or you can provide a fallback style (see [`fallback-style`](#inputs)). You can also provide a path to check. If you want to run checks against multiple paths in your repository, you can use this action in a [matrix run](#multiple-paths).
1010

1111
## Major versions supported
1212
* 3: `clang-format-3.9`
@@ -17,7 +17,7 @@ You can define your own formatting rules in a `.clang-format` file at your repos
1717
* 8: `clang-format-8`
1818
* 9: `clang-format-9`
1919
* 10: `clang-format-10`
20-
* 11: `clang-format-11`
20+
* 11: `clang-format-11`
2121
* 12: `clang-format-12`
2222
* 13: `clang-format-13`
2323
* 14: `clang-format-14`
@@ -26,6 +26,14 @@ You can define your own formatting rules in a `.clang-format` file at your repos
2626
* 17: `clang-format-17`
2727
* 18: `clang-format-18`
2828

29+
## Action version upgrade guarantee
30+
31+
> [!IMPORTANT]
32+
> This action complies with the [Semantic Versioning spec](https://semver.org) for how it's called from GitHub Actions workflows. This means that for version format `x.y.z`, minor and patch version increments `y++` and `z++` will not break existing functionality for how this action is called in your GitHub Actions workflows. Major version increments (`x++`) *will* include breaking changes in how this action is called. If you notice version changes that violate this guarantee, [open an issue](https://github.com/jidicula/clang-format-action/issues/new?template=Blank+issue) and let's work together to fix it 😁.
33+
34+
> [!CAUTION]
35+
> I provide no guarantees for formatting breakages *within* `clang-format` versions. This action only supports major versions of `clang-format` and doesn't support granular specification of `clang-format` minor or patch versions. It's possible that a formatting check workflow using this action and a pinned version of `clang-format` could break in a subsequent run if the underlying `clang-format` Ubuntu package has introduced a breaking minor or patch version change. I'm not sure how often this happens - vote in [this poll](https://github.com/jidicula/clang-format-action/discussions/192) and optionally leave a comment so I can understand this problem more.
36+
2937
## Do you find this useful?
3038

3139
You can sponsor me [here](https://github.com/sponsors/jidicula)!
@@ -42,10 +50,10 @@ You can sponsor me [here](https://github.com/sponsors/jidicula)!
4250
* Available values: `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit` and others listed in the `clang-format` [docs for BasedOnStyle](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options).
4351
* `exclude-regex` [optional]: A regex to exclude files or directories that should not be checked.
4452
* Default: `^$`
45-
* Pattern matching is done with a POSIX `grep -E` extended regex, **not** a glob expression. You can exclude multiple patterns like this: `(hello|world)`. Build and verify your regex at https://regex101.com .
53+
* Pattern matching is done with a POSIX `grep -E` extended regex, **not** a glob expression. You can exclude multiple patterns like this: `(hello|world)`. Build and verify your regex at [regex101.com](https://regex101.com) ([example](https://regex101.com/r/llFcLy/7)).
4654
* `include-regex` [optional]: A regex to include files or directories that should be checked.
47-
* Default: `^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$))|(ino|pde|proto|cu))$`
48-
* Pattern matching is done with a POSIX `grep -E` extended regex, **not** a glob expression. You can exclude multiple patterns like this: `(hello|world)`. Build and verify your regex at https://regex101.com .
55+
* Default: see [`INCLUDE_REGEX`](./check.sh#77)
56+
* Pattern matching is done with a POSIX `grep -E` extended regex, **not** a glob expression. You can exclude multiple patterns like this: `(hello|world)`. Build and verify your regex at [regex101.com](https://regex101.com) ([example](https://regex101.com/r/llFcLy/7)).
4957

5058
This action checks all C/C++/Protobuf (including Arduino `.ino` and `.pde`) files in the provided directory in the GitHub workspace are formatted correctly using `clang-format`. If no directory is provided or the provided path is not a directory in the GitHub workspace, all C/C++/Protobuf files are checked.
5159

@@ -77,7 +85,8 @@ The following file extensions are checked by default:
7785

7886
# Usage
7987

80-
⚠️This action does not run on `windows` GitHub Actions runners!
88+
> [!WARNING]
89+
> This action is not supported on `windows` GitHub Actions runners!
8190
8291
## Single Path
8392

@@ -91,9 +100,9 @@ jobs:
91100
name: Formatting Check
92101
runs-on: ubuntu-latest
93102
steps:
94-
- uses: actions/checkout@v3
103+
- uses: actions/checkout@v4
95104
- name: Run clang-format style check for C/C++/Protobuf programs.
96-
uses: jidicula/clang-format-action@v4.11.0
105+
uses: jidicula/clang-format-action@v4.12.0
97106
with:
98107
clang-format-version: '13'
99108
check-path: 'src'
@@ -116,9 +125,9 @@ jobs:
116125
- 'src'
117126
- 'examples'
118127
steps:
119-
- uses: actions/checkout@v3
128+
- uses: actions/checkout@v4
120129
- name: Run clang-format style check for C/C++/Protobuf programs.
121-
uses: jidicula/clang-format-action@v4.11.0
130+
uses: jidicula/clang-format-action@v4.12.0
122131
with:
123132
clang-format-version: '13'
124133
check-path: ${{ matrix.path }}
@@ -143,9 +152,9 @@ jobs:
143152
- check: 'examples'
144153
exclude: '' # Nothing to exclude
145154
steps:
146-
- uses: actions/checkout@v3
155+
- uses: actions/checkout@v4
147156
- name: Run clang-format style check for C/C++/Protobuf programs.
148-
uses: jidicula/clang-format-action@v4.11.0
157+
uses: jidicula/clang-format-action@v4.12.0
149158
with:
150159
clang-format-version: '13'
151160
check-path: ${{ matrix.path['check'] }}
@@ -155,4 +164,4 @@ jobs:
155164

156165
# Who uses this?
157166

158-
[These public repos](https://github.com/search?o=desc&q=uses%3A+jidicula%2Fclang-format-action+-user%3Ajidicula&s=indexed&type=Code) use this Action.
167+
[These public repos](https://github.com/search?q=%22uses%3A+jidicula%2Fclang-format-action%22+-user%3Ajidicula&type=code) use this Action.

SECURITY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Supported Versions
44

5-
| Version | Supported |
6-
| ------- | ------------------ |
7-
| 4.11.x | :white_check_mark: |
8-
| < 4.11.x | :x: |
5+
| Version | Supported |
6+
|----------|--------------------|
7+
| 4.12.x | :white_check_mark: |
8+
| < 4.12.x | :x: |
99

1010
## Reporting a Vulnerability
1111

0 commit comments

Comments
 (0)