From bd03e80b52019bdf31d5a0382608049f3889e8b8 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 20 May 2022 23:46:15 +0300 Subject: [PATCH] Add pre-commit with CI and issue templates --- .editorconfig | 15 ++++++++++++++ .github/ISSUE_TEMPLATE/bug.md | 7 +++++++ .github/ISSUE_TEMPLATE/config.yml | 7 +++++++ .github/ISSUE_TEMPLATE/enhancement.md | 6 ++++++ .github/workflows/go.yml | 29 +++++++++++++++++++++++++++ .pre-commit-config.yaml | 14 +++++++++++++ remoteauth/README.md | 2 +- 7 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/enhancement.md create mode 100644 .github/workflows/go.yml create mode 100644 .pre-commit-config.yaml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..02798cd --- /dev/null +++ b/.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 diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..02ed284 --- /dev/null +++ b/.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 + +--- diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ee47cff --- /dev/null +++ b/.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. diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md new file mode 100644 index 0000000..264e67f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -0,0 +1,6 @@ +--- +name: Enhancement request +about: Submit a feature request or other suggestion +labels: enhancement + +--- diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..1a523ab --- /dev/null +++ b/.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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..abb3979 --- /dev/null +++ b/.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 diff --git a/remoteauth/README.md b/remoteauth/README.md index 1e94910..9050fb9 100644 --- a/remoteauth/README.md +++ b/remoteauth/README.md @@ -51,4 +51,4 @@ func main() { fmt.Printf("user: %q\n", user) fmt.Printf("err: %v\n", err) } -``` \ No newline at end of file +```