Skip to content

Commit 4d8e9e7

Browse files
authored
Copyright notice and whitespace check (#78)
1 parent 7b4a4d5 commit 4d8e9e7

13 files changed

Lines changed: 147 additions & 12 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: check copyright
2+
on:
3+
pull_request:
4+
paths:
5+
- '.github/workflows/check-copyright.yml'
6+
- '.pre-commit-config.yaml'
7+
- 'scripts/check_copyright_notice.py'
8+
- '**/*.go'
9+
- '!**/docs/**/*'
10+
- '!**/*.md'
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
copyright:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Harden Runner
24+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
25+
with:
26+
egress-policy: audit
27+
28+
- name: Checkout devtools
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
31+
- name: Check copyright notice
32+
run: |
33+
pip install \
34+
pre-commit \
35+
comment-parser>=1.2.3
36+
pre-commit run --all-files

.github/workflows/markdown.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ jobs:
5555
use-verbose-mode: 'yes'
5656
base-branch: ${{ github.base_ref }}
5757
config-file: '.github/markdown-link-check.jsonc'
58-

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
sudo apt-get update
122122
sudo apt-get install \
123123
ninja-build
124-
124+
125125
- name: Install windows deps
126126
if: ${{ startsWith(matrix.platform, 'windows') }}
127127
run: choco install -y ninja
@@ -182,7 +182,7 @@ jobs:
182182
with:
183183
files: "artifacts/**/vidx2pidx-testreport-*.xml"
184184
report_individual_runs: true
185-
185+
186186
coverage:
187187
if: ${{ github.workflow != 'Release' && github.repository == 'Open-CMSIS-Pack/vidx2pidx' }}
188188
needs: [ test ]

.github/workflows/tpip-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: |
5252
go-licenses report . --ignore github.com/Open-CMSIS-Pack/vidx2pidx --template ../scripts/template/${{ env.tpip_report }}.template > ../${{ env.tpip_report }}
5353
working-directory: ./cmd
54-
54+
5555
- name: Archive TPIP report
5656
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5757
with:

.goreleaser.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ archives:
2727
# You can also set it to a custom folder name (templating is supported).
2828
# Default is false.
2929
wrap_in_directory: true
30-
31-

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
name: Fix end of files
7+
description: Ensures files end with a newline
8+
- id: trailing-whitespace
9+
name: Check for trailing whitespace
10+
description: Fails and fix files with trailing whitespace
11+
12+
- repo: local
13+
hooks:
14+
- id: check-copyright-notice
15+
name: Check for copyright notice
16+
description: Ensures source files include a copyright notice
17+
entry: python3 scripts/check_copyright_notice.py
18+
language: system
19+
types: [go]

DEVELOPING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ If you have push access to the `main` branch, you can create a new release by ru
5353
make release
5454
```
5555

56-
📌 **Note:** We follow [Semantic Versioning](https://semver.org/) for versioning `vidx2pidx`.
56+
📌 **Note:** We follow [Semantic Versioning](https://semver.org/) for versioning `vidx2pidx`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Just head to the release page and download the binary for your system.
5555
$ vidx2pidx <index>.vidx
5656

5757
Options:
58-
58+
5959
-h, --help show usage and help info
6060
-V, --version show version and copyright info
6161
-v, --verbose show progress details

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Security
1+
# Security
22

33
For reporting security issues, please follow the official guidelines outlined in [SECURITY.md](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/SECURITY.md).

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test:
6565

6666
test-all: format-check coverage-check lint
6767

68-
coverage-report:
68+
coverage-report:
6969
TESTING=1 go test ./... -coverprofile cover.out
7070
go tool cover -html=cover.out
7171

0 commit comments

Comments
 (0)