Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Content #1

Merged
merged 13 commits into from
Apr 15, 2024
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @DoctorVin @joelrebel @mmlb
40 changes: 40 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: lint
on:
- pull_request
- push
jobs:
Prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run prettier
env:
# renovate datasource=npm depName=prettier
PRETTIER_VERSION: 3.2.5
run: |
npx --yes prettier@$PRETTIER_VERSION --check . && exit 0
npx prettier@$PRETTIER_VERSION --write
git diff
exit 1

VerifyConfig:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Install golangci-lint
env:
# renovate datasource=git-tags depName=https://github.com/golangci/golangci-lint
GOLANGCI_LINT_VERSION: v1.57
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_LINT_VERSION

- name: Verify .golangci.yml file
run: golangci-lint config verify -c .golangci.yml
93 changes: 93 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#
# This file lives in the github.com/metal-toolbox/golangci-lint-config repo.
#
# Do not edit this file outside of this repo otherwise we will be grumpy.
# Seriously though, this is meant to help promote a "standard" config and coding style.
# If you don't like something, lets have a discussion in GitHub issues!
#

linters-settings:
dupl:
threshold: 125
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- experimental
- performance
- style
disabled-checks:
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 15
gofumpt:
extra-rules: true
govet:
enable:
- shadow
lll:
line-length: 140
misspell:
locale: US
revive:
confidence: 0

linters:
enable-all: true
disable-all: false
# Linters we don't like
# Comments help explain why its disabled or point at ones we should not disable but will take a little work
# If its not commented its likely because its just too annoying or we don't find useful
disable:
- copyloopvar # requires go >=1.22
- cyclop
- deadcode # deprecated
- depguard
- errname # maybe should be enabled
- exhaustivestruct # deprecated
- exhaustruct
- forbidigo
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- godot
- godox
- golint # deprecated
- gomnd
- ifshort # deprecated
- inamedparam
- interfacebloat
- interfacer # deprecated
- intrange # requires go >=1.22
- ireturn # should be enabled, ironlib needs some changes
- lll # not previously enabled, ironlib and mctl both fail this
- maligned # deprecated
- nestif
- nilnil
- nlreturn
- nolintlint
- nonamedreturns # should be enabled, probably
- nosnakecase # deprecated
- paralleltest
- perfsprint
- scopelint # deprecated
- structcheck # deprecated
- tagliatelle
- tenv # should be enabled
- testpackage
- testifylint # should be enabled
- thelper # should be enabled
- varcheck # deprecated
- varnamelen
- wrapcheck
- wsl

issues:
exclude-rules:
- linters:
- stylecheck
text: "ST1016"
28 changes: 28 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": ["config:base", ":dependencyDashboard", ":rebaseStalePrs"],
"addLabels": ["dependencies"],
"labels": ["dependencies"],
"packageRules": [
{
"description": "Automatically merge minor and patch-level updates",
"matchUpdateTypes": ["minor", "patch", "digest"],
"automerge": true
}
],
"rebaseWhen": "auto",
"rollbackPrs": true,
"stabilityDays": 3,
"vulnerabilityAlerts": {
"enabled": true,
"labels": ["security"]
},
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^.github/workflows/lint.yaml$"],
"matchStrings": [
"# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^\\s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[^\\s]+?))?(?: extractVersion=(?<extractVersion>[^\\s]+?))?\\s+[A-Za-z0-9_]+?_VERSION\\s*:\\s*[\"']?(?<currentValue>.+?)[\"']?\\s"
]
}
]
}
Loading