Skip to content

Commit b24066f

Browse files
committed
RFC: Try out running pre-made pre-commit hooks via github actions
1 parent de19eeb commit b24066f

File tree

5 files changed

+38
-4
lines changed

5 files changed

+38
-4
lines changed

.github/scripts/kernel_checker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
KERNEL_IGNORED_EXTENSIONS = [
1414
'.yml',
15+
'.yaml',
1516
'.css',
1617
'.idx',
1718
'.md',
@@ -92,4 +93,3 @@ def main():
9293

9394
if __name__ == '__main__':
9495
exit(main())
95-

.github/workflows/ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: CI Checks
22
on:
3-
push:
4-
branches: ["**"]
53
pull_request:
64
branches: [main]
75
workflow_dispatch:
@@ -44,4 +42,3 @@ jobs:
4442
- name: URL Checker
4543
run: |
4644
bash kernel/.github/actions/url_verifier.sh kernel
47-

.github/workflows/pre-commit.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Linters
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pre-commit:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-python@v2
12+
- id: file_changes
13+
uses: trilom/[email protected]
14+
with:
15+
output: ' '
16+
- uses: pre-commit/[email protected]
17+
with:
18+
extra_args: --files ${{ steps.file_changes.outputs.files}}

.pre-commit-config.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: mixed-line-ending
12+
args : [--fix=auto]
13+
- id: check-case-conflict
14+
- id: check-executables-have-shebangs
15+
- id: check-json
16+
- id: check-merge-conflict
17+
- id: check-symlinks
18+
- id: check-ast

event_groups.c

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
/* Standard includes. */
2828
#include <stdlib.h>
29+
/* make a change that breaks things */
2930

3031
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
3132
* all the API functions to use the MPU wrappers. That should only be done when

0 commit comments

Comments
 (0)