Skip to content

Commit 214fe94

Browse files
authored
Merge pull request #21 from Bahjat/feature/adds-GA-workflow-pr
adds a GitHub Actions workflow runs on pull requests
2 parents 206548e + 0ed92d9 commit 214fe94

File tree

2 files changed

+50
-15
lines changed

2 files changed

+50
-15
lines changed

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
# 1) Check out the code
11+
- name: Check out repository
12+
uses: actions/checkout@v3
13+
14+
# 2) Install and run ShellCheck on *.sh
15+
- name: Install ShellCheck
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y shellcheck
19+
- name: Run ShellCheck
20+
run: |
21+
shellcheck ./*.sh
22+
23+
# 3) Install Node and run markdownlint on *.md
24+
- name: Setup Node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 16
28+
29+
- name: Install markdownlint-cli
30+
run: npm install -g markdownlint-cli
31+
32+
- name: Run markdownlint
33+
run: |
34+
markdownlint ./**/*.md

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# pre-commit-golang
22

3-
Golang pre-commit hooks for http://pre-commit.com/
3+
Golang pre-commit hooks for [pre-commit.com](http://pre-commit.com/)
44

5-
## install
5+
## Installation
66

7-
you need first to install [pre-commit](https://pre-commit.com/#install)
7+
You first need to install [pre-commit](https://pre-commit.com/#install):
88

9-
```
9+
```bash
1010
brew install pre-commit
1111
```
1212

13-
install pre-commit into your git repo
13+
Then install pre-commit in your Git repository:
1414

15-
```
15+
```bash
1616
pre-commit install
1717
```
1818

1919
## Usage
2020

21-
Add a file named `.pre-commit-config.yaml` into the root directory of your repository
21+
Add a file named `.pre-commit-config.yaml` to the root directory of your repository:
2222

2323
```yaml
2424
repos:
2525
- repo: https://github.com/Bahjat/pre-commit-golang
26-
rev: v1.0.2
26+
rev: v1.0.5
2727
hooks:
2828
- id: go-fmt-import
2929
- id: go-vet
@@ -35,21 +35,22 @@ repos:
3535
- id: golangci-lint # requires github.com/golangci/golangci-lint
3636
args: [--config=.github/linters/.golangci.yml] # optional
3737
- id: go-ruleguard # requires https://github.com/quasilyte/go-ruleguard
38-
args: [rules/rules.go] # required
38+
args: [rules/rules.go]
39+
- id: go-imports-reviser # requires https://github.com/incu6us/goimports-reviser
3940
```
4041
4142
## Contributing
4243
4344
- Fork it
44-
- Create your feature branch `git checkout -b my-new-feature`
45-
- Commit your changes `git commit -am 'Add some feature'`
46-
- Push to the branch `git push origin my-new-feature`
47-
- Create new Pull Request
45+
- Create your feature branch: `git checkout -b my-new-feature`
46+
- Commit your changes: `git commit -am 'Add some feature'`
47+
- Push to the branch: `git push origin my-new-feature`
48+
- Create a new Pull Request
4849

4950
## Credits
5051

51-
This repo is inspired by [dnephin/pre-commit-golang](https://github.com/dnephin/pre-commit-golang)
52+
This repository is inspired by [dnephin/pre-commit-golang](https://github.com/dnephin/pre-commit-golang).
5253

5354
## Finally
5455

55-
If you like this hooks please give a star
56+
If you like these hooks, please give this repository a star!

0 commit comments

Comments
 (0)