You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Change action from docker to composite
* Remove Dockerfile
* install cpp-linter pkg from PyPI
* Remove publish-pypi.yml #91
* Switch from master to main branch
* Add CONTRIBUTING.md
Thank you for investing your time in contributing to our project! We welcome feedback, bug reports, and pull requests!
4
+
5
+
## New contributor guide
6
+
7
+
Ours develop branch is `main` not `master` (`master` used to be the develop branch for v1.x).
8
+
9
+
The reason we didn't delete the `master` branch is that there are still users whose workflows point to the `master` branch.
10
+
11
+
For pull requests, please stick to the following guidelines
12
+
13
+
* Add tests for any new features and bug fixes.
14
+
* Put a reasonable amount of comments into the code.
15
+
* Fork cpp-linter-action on your GitHub user account, do your changes there and then create a PR against `main` branch of cpp-linter-action repository.
16
+
* Separate unrelated changes into multiple pull requests.
17
+
18
+
If you wish to contribute to the python source package used by this action, then that has moved to it's own repository named [cpp-linter](https://github.com/cpp-linter/cpp-linter) as of v2 of this action.
19
+
20
+
Please note that by contributing any code or documentation to this repository (by raising pull requests, or otherwise) you explicitly agree to the [License Agreement](LICENSE).
A Github Action for linting C/C++ code integrating clang-tidy and clang-format to collect feedback provided in the form of thread comments and/or annotations.
13
13
14
+
## What's New
15
+
16
+
v2
17
+
18
+
* Change action from using docker to composite steps
19
+
* improve workflow runs times from 1m 24s (currently) to 6-20s.
20
+
* better support for the database input option (which is currently broken with the docker env).
21
+
* better support cross-compilation
22
+
* better support 3rd party libraries
23
+
* Includes many issues and enhancements. See [#87](https://github.com/cpp-linter/cpp-linter-action/issues/87) for details.
24
+
25
+
Refer [here](https://github.com/cpp-linter/cpp-linter-action/tree/v1) for previous versions.
26
+
14
27
## Usage
15
28
16
-
Create a new GitHub Actions workflow in your project, e.g. at [.github/workflows/cpp-linter.yml](https://github.com/cpp-linter/cpp-linter-action/blob/master/.github/workflows/cpp-linter.yml)
29
+
Create a new GitHub Actions workflow in your project, e.g. at [.github/workflows/cpp-linter.yml](https://github.com/cpp-linter/cpp-linter-action/blob/main/.github/workflows/cpp-linter.yml)
17
30
18
31
The content of the file should be in the following format.
types: [opened, reopened] # let PR-synchronize events be handled by push events
28
-
push:
36
+
on: pull_request
29
37
30
38
jobs:
31
39
cpp-linter:
32
40
runs-on: ubuntu-latest
33
41
steps:
34
42
- uses: actions/checkout@v3
35
-
- uses: cpp-linter/cpp-linter-action@v1
43
+
- uses: cpp-linter/cpp-linter-action@v2
36
44
id: linter
37
45
env:
38
46
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -74,9 +82,9 @@ jobs:
74
82
75
83
#### `version`
76
84
77
-
-**Description**: The desired version of the [clang-tools](https://hub.docker.com/r/xianpengshen/clang-tools) to use. Accepted options are strings which can be 14, 13, 12, 11, 10, 9, or 8.
85
+
-**Description**: The desired version of the [clang-tools](https://github.com/cpp-linter/clang-tools-pip) to use. Accepted options are strings which can be 14, 13, 12, 11, 10, 9, 8,7, 6, 5, 4 or 3.9.
78
86
- Set this option to a blank string (`''`) to use the platform's default installed version.
79
-
- This value can also be a path to where the clang tools are installed (if using a custom install location). Because all paths specified here are converted to absolute, using a relative path as a value may not be compatible when using the docker environment (see [Running without the docker container](#running-without-the-docker-container)).
87
+
- This value can also be a path to where the clang tools are installed (if using a custom install location).
80
88
- Default: '12'
81
89
82
90
#### `verbosity`
@@ -130,119 +138,25 @@ jobs:
130
138
#### `database`
131
139
132
140
-**Description**: The directory containing compilation database (like compile_commands.json) file.
133
-
- This option doesn't seems to work properly from the docker environment. Instead we recommend using this option when see [running without the docker container](#running-without-the-docker-container).
134
141
- Default: ''
135
142
136
143
### Outputs
137
144
138
145
This action creates 1 output variable named `checks-failed`. Even if the linting checks fail for source files this action will still pass, but users' CI workflows can use this action's output to exit the workflow early if that is desired.
139
146
140
-
## Running without the docker container
141
-
142
-
Some Continuous Integration environments require access to non-default compilers
143
-
and/or non-standard libraries. To do this properly, the docker container should
144
-
not be used due to it's isolated file system. Instead, you should use this action's
145
-
python source code as an installed python package (see below).
146
-
147
-
### Using the python source code
148
-
149
-
This action was originally designed to only be used on a runner with the Ubuntu
150
-
Operating System. However, this action's source code (essentially a python package)
151
-
can be used on any runner using the Windows, Ubuntu, or possibly even MacOS (untested)
152
-
virtual environments.
153
-
154
-
Note, some runners already ship with clang-format and/or clang-tidy. As of this writing, the following versions of clang-format and clang-tidy are already available:
155
-
156
-
-`ubuntu-latest` ships with v10, v11, and v12. [More details](https://github.com/actions/virtual-environments/blob/ubuntu20/20220508.1/images/linux/Ubuntu2004-Readme.md).
157
-
-`windows-latest` ships with v13. [More details](https://github.com/actions/virtual-environments/blob/win22/20220511.2/images/win/Windows2022-Readme.md).
158
-
-`macos-latest` ships with v13. [More details](https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md).
# Pass the installed path to the '--version' argument.
195
-
# Alternatively, pass the version number.
196
-
# Example. run: cpp-linter --version=14
197
-
# Omit the version option if using the default version available in the OS.
198
-
run: cpp-linter --version=${{ runner.temp }}/llvm
199
-
200
-
- name: Fail fast?!
201
-
if: steps.linter.outputs.checks-failed > 0
202
-
run: echo "Some files failed the linting checks!"
203
-
# for actual deployment
204
-
# run: exit 1
205
-
```
206
-
207
-
All input options listed above are specified by pre-pending a `--`. You can also install this repo locally and run `cpp-linter -h` for more detail. For example:
@@ -264,6 +178,6 @@ To provide feedback (requesting a feature or reporting a bug) please post to [is
264
178
265
179
## License
266
180
267
-
The scripts and documentation in this project are released under the [MIT License](https://github.com/cpp-linter/cpp-linter-action/blob/master/LICENSE)
181
+
The scripts and documentation in this project are released under the [MIT License](https://github.com/cpp-linter/cpp-linter-action/blob/main/LICENSE)
0 commit comments