Эх сурвалжийг харах

Add pre-commit with CI and issue templates

Tulir Asokan 3 жил өмнө
parent
commit
bd03e80b52

+ 15 - 0
.editorconfig

@@ -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 - 0
.github/ISSUE_TEMPLATE/bug.md

@@ -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 - 0
.github/ISSUE_TEMPLATE/config.yml

@@ -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 - 0
.github/ISSUE_TEMPLATE/enhancement.md

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

+ 29 - 0
.github/workflows/go.yml

@@ -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 - 0
.pre-commit-config.yaml

@@ -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

+ 1 - 1
remoteauth/README.md

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