Skip to content

Commit ba2b115

Browse files
committed
norminette-action@v2 (Norm version 2)
0 parents  commit ba2b115

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# norminette-action@v2
2+
3+
This GitHub Action checks if your code passes the 42School's norminette linter, after each push.
4+
See a demo on [alexandregv/norminette-action-demo](https://github.com/alexandregv/norminette-action-demo).
5+
6+
**/!\\ This version (`@v2`) is for Norm version 2, if you want Norm version 3 please use [norminette-action@v3](https://github.com/alexandregv/norminette-action/tree/v3) /!\\**
7+
8+
## Inputs
9+
10+
### `flags`
11+
12+
Description: Flags passed to norminette.
13+
Format: `[options] <path>`
14+
Default: `.` (all files)
15+
16+
## Example usage
17+
18+
```yml
19+
# .github/workflows/main.yml
20+
on: [push, pull_request]
21+
22+
jobs:
23+
norminette_job:
24+
runs-on: ubuntu-latest
25+
name: norminette
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: alexandregv/norminette-action@v2
29+
with:
30+
flags: '.'
31+
```
32+
33+
## Badge
34+
35+
You can add a badge (![norminette](https://github.com/alexandregv/norminette-action-demo/workflows/norminette/badge.svg)) to show current norminette status by adding this markdown code to your README.md:
36+
```md
37+
![norminette](https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_NAME_OR_FILE>/badge.svg)
38+
```
39+
More infos on [GitHub Docs](https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/adding-a-workflow-status-badge).
40+
41+
## See also
42+
43+
* [norminette-action-demo](https://github.com/alexandregv/norminette-action-demo) - Demo repository for this action.
44+
* [norminette-docker](https://github.com/alexandregv/norminette-docker) - Docker image for norminette (used by this action).
45+
* [norminette-vim](https://github.com/alexandregv/norminette-vim) - Vim integration for norminette. Displays norm errors directly inside Vim.
46+
47+
All of these are compatible with Norm version 2 and 3.

action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: '42 Norminette'
2+
description: 'Check 42 Norm with norminette linter'
3+
author: 'Reach <[email protected]>'
4+
branding:
5+
icon: 'activity'
6+
color: 'gray-dark'
7+
8+
inputs:
9+
flags:
10+
description: 'Flags passed to norminette'
11+
required: true
12+
default: '.'
13+
runs:
14+
using: 'docker'
15+
image: 'docker://alexandregv/norminette:v2'
16+
entrypoint: /bin/bash
17+
args:
18+
- -c
19+
- /usr/src/norminette/norminette.rb ${{ inputs.flags }} | grep -v "Not a valid file" | grep -B1 -E "^Error|Warning"; test $? -eq 1

0 commit comments

Comments
 (0)