From 9bafaad58eb951d7a015ab619201a96c1844447f Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Sun, 26 Sep 2021 16:04:41 -0400 Subject: [PATCH] Fixed lint issues --- .github/mergify.yml | 8 ++-- .github/workflows/codeql-analysis.yml | 66 +++++++++++++-------------- .github/workflows/run-tests.yml | 8 ++-- .yamllint.yml | 36 +++++++++++++++ README.md | 2 +- 5 files changed, 78 insertions(+), 42 deletions(-) create mode 100644 .yamllint.yml diff --git a/.github/mergify.yml b/.github/mergify.yml index cb093f6..f41d882 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -54,7 +54,7 @@ pull_request_rules: - "#assignee=0" actions: assign: - users: [ "mrz1836" ] + users: ["mrz1836"] # =============================================================================== # ALERTS @@ -112,13 +112,13 @@ pull_request_rules: - "head~=(?i)^(bug)?fix" # if the PR branch starts with (bug)?fix/ actions: label: - add: [ "bug-P3" ] + add: ["bug-P3"] - name: Documentation label conditions: - "head~=(?i)^docs" # if the PR branch starts with docs/ actions: label: - add: [ "documentation" ] + add: ["documentation"] - name: Feature label conditions: - "head~=(?i)^feat(ure)?" # if the PR branch starts with feat(ure)?/ @@ -180,7 +180,7 @@ pull_request_rules: message: | This pull request looks stale. Feel free to reopen it if you think it's a mistake. label: - add: [ "stale" ] + add: ["stale"] # =============================================================================== # BRANCHES diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bdbb1cd..d7d4412 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,43 +29,43 @@ jobs: # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + # - run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d3fb5ea..470b92f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,7 +11,7 @@ on: push: branches: - "*" - #schedule: + # schedule: # - cron: '1 4 * * *' jobs: @@ -33,13 +33,13 @@ jobs: run: go list -json -m all > go.list - name: Ask Nancy uses: sonatype-nexus-community/nancy-github-action@v1.0.2 - #continue-on-error: true + # continue-on-error: true test: needs: [yamllint, asknancy] strategy: matrix: - go-version: [ 1.16.x, 1.17.x ] - os: [ ubuntu-latest ] + go-version: [1.16.x, 1.17.x] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Install Go diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..c310c96 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,36 @@ +--- + +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' + +ignore: | + dist/ + +rules: + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + level: warning + comments-indentation: + level: warning + document-end: disable + document-start: + level: warning + empty-lines: enable + empty-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: disable + new-line-at-end-of-file: disable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: + level: warning diff --git a/README.md b/README.md index fab8fb0..2f828e5 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ This repository was created using [MrZ's `go-template`](https://github.com/mrz18 - Continuous integration via [GitHub Actions](https://github.com/features/actions) - Build automation via [Make](https://www.gnu.org/software/make) - Dependency management using [Go Modules](https://github.com/golang/go/wiki/Modules) -- Code formatting using [gofumpt](https://github.com/mvdan/gofumpt) and linting with [golangci-lint](https://github.com/golangci/golangci-lint) +- Code formatting using [gofumpt](https://github.com/mvdan/gofumpt) and linting with [golangci-lint](https://github.com/golangci/golangci-lint) and [yamllint](https://yamllint.readthedocs.io/en/stable/index.html) - Unit testing with [testify](https://github.com/stretchr/testify), [race detector](https://blog.golang.org/race-detector), code coverage [HTML report](https://blog.golang.org/cover) and [Codecov report](https://codecov.io/) - Releasing using [GoReleaser](https://github.com/goreleaser/goreleaser) - Dependency scanning and updating thanks to [Dependabot](https://dependabot.com) and [Nancy](https://github.com/sonatype-nexus-community/nancy)