Add pre-commit with CI and issue templates

This commit is contained in:
Tulir Asokan 2022-05-20 23:46:15 +03:00
parent b8990c1898
commit bd03e80b52
7 changed files with 79 additions and 1 deletions

15
.editorconfig Normal file
View file

@ -0,0 +1,15 @@
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{yaml,yml}]
indent_style = space
[.gitlab-ci.yml]
indent_size = 2

7
.github/ISSUE_TEMPLATE/bug.md vendored Normal file
View file

@ -0,0 +1,7 @@
---
name: Bug report
about: If something is definitely wrong in the bridge (rather than just a setup issue),
file a bug report. Remember to include relevant logs.
labels: bug
---

7
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,7 @@
contact_links:
- name: Troubleshooting docs & FAQ
url: https://docs.mau.fi/bridges/general/troubleshooting.html
about: Check this first if you're having problems setting up the bridge.
- name: Support room
url: https://matrix.to/#/#discord:maunium.net
about: For setup issues not answered by the troubleshooting docs, ask in the Matrix room.

6
.github/ISSUE_TEMPLATE/enhancement.md vendored Normal file
View file

@ -0,0 +1,6 @@
---
name: Enhancement request
about: Submit a feature request or other suggestion
labels: enhancement
---

29
.github/workflows/go.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Go
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: [1.18]
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
export PATH="$HOME/go/bin:$PATH"
- name: Install pre-commit
run: pip install pre-commit
- name: Lint
run: pre-commit run -a

14
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
exclude_types: [markdown]
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-beta.5
hooks:
- id: go-imports-repo

View file

@ -51,4 +51,4 @@ func main() {
fmt.Printf("user: %q\n", user)
fmt.Printf("err: %v\n", err)
}
```
```