Configure Renovate (#116)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Paramtamtam <7326800+tarampampam@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2022-06-12 12:55:49 +05:00 committed by GitHub
parent bde35e2c79
commit 48bd1a44e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 40 deletions

View File

@ -10,7 +10,7 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.{yml, yaml, sh, conf}]
[*.{yml, yaml, sh, conf, json}]
indent_size = 2
[{Makefile, go.mod, *.go}]

7
.github/renovate.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>tarampampam/.github//renovate/default",
":rebaseStalePrs"
]
}

View File

@ -25,14 +25,7 @@ jobs: # Docs: <https://git.io/JvxXE>
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with: {go-version: 1.17} # On v1.18 I had an error "panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt"
- name: Run linter
uses: golangci/golangci-lint-action@v3 # Action page: <https://github.com/golangci/golangci-lint-action>
with:
version: v1.44 # without patch version
only-new-issues: false # show only new issues if it's a pull request
- uses: golangci/golangci-lint-action@v3 # Action page: <https://github.com/golangci/golangci-lint-action>
validate-config-file:
name: Validate config file
@ -242,13 +235,7 @@ jobs: # Docs: <https://git.io/JvxXE>
- working-directory: .artifact
run: docker load < docker-image.tar
- name: Download hurl
env:
VERSION: 1.5.0
run: curl -SL -o hurl.deb https://github.com/Orange-OpenSource/hurl/releases/download/${VERSION}/hurl_${VERSION}_amd64.deb
- name: Install hurl
run: sudo dpkg -i hurl.deb
- uses: gacts/install-hurl@v1
- name: Run container with the app
run: docker run --rm -d -p "8080:8080/tcp" -e "SHOW_DETAILS=true" -e "PROXY_HTTP_HEADERS=X-Foo,Bar,Baz_blah" --name app app:ci

View File

@ -43,8 +43,6 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
enable:
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
- bidichk # Checks for dangerous unicode character sequences
- bodyclose # Checks whether HTTP response body is closed successfully
- contextcheck # check the function whether use a non-inherited context
- deadcode # Finds unused code
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
@ -73,17 +71,12 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
- nakedret # Finds naked returns in functions greater than a specified function length
- nestif # Reports deeply nested if statements
- nlreturn # checks for a new line before return and branch statements to increase code clarity
- noctx # finds sending http request without context.Context
- nolintlint # Reports ill-formed or insufficient nolint directives
- prealloc # Finds slice declarations that could potentially be preallocated
- rowserrcheck # Checks whether Err of rows is checked successfully
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- structcheck # Finds unused struct fields
- stylecheck # Stylecheck is a replacement for golint
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
- unused # Checks Go code for unused constants, variables, functions and types
- varcheck # Finds unused global variables and constants
- whitespace # Tool for detection of leading and trailing whitespace
@ -97,4 +90,3 @@ issues:
- funlen
- scopelint
- gocognit
- noctx

View File

@ -23,22 +23,15 @@ services:
<<: *app-service
ports:
- "8080:8080/tcp" # Open <http://127.0.0.1:8080>
command:
- go
- run
- ./cmd/error-pages
- serve
- --verbose
- --port=8080
- --show-details
- --proxy-headers=X-Foo,Bar,Baz_blah
command: sh -c "go build -o /tmp/app ./cmd/error-pages && /tmp/app serve"
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'http://127.0.0.1:8080/healthz']
interval: 5s
timeout: 2s
test: ['CMD', '/tmp/app', 'healthcheck', '--log-json']
interval: 4s
timeout: 1s
start_period: 5s
golint:
image: golangci/golangci-lint:v1.44-alpine # Image page: <https://hub.docker.com/r/golangci/golangci-lint>
image: golangci/golangci-lint:v1.46-alpine # Image page: <https://hub.docker.com/r/golangci/golangci-lint>
environment:
GOLANGCI_LINT_CACHE: /tmp/golint # <https://github.com/golangci/golangci-lint/blob/v1.42.0/internal/cache/default.go#L68>
volumes:
@ -53,5 +46,4 @@ services:
- .:/src:ro
working_dir: /src
depends_on:
web:
condition: service_healthy
web: {condition: service_healthy}

View File

@ -206,7 +206,7 @@ func (tr *TemplateRenderer) Close() error {
}
func (tr *TemplateRenderer) mixHashes(a, b Hash) (result cacheEntryHash) {
for i := 0; i < len(a); i++ {
for i := 0; i < len(a); i++ { //nolint:gosimple
result[i] = a[i]
}