Skip to content

Commit

Permalink
Merge pull request #3 from aserto-dev/makefile
Browse files Browse the repository at this point in the history
rm mage, add makefile
  • Loading branch information
ronenh authored Oct 30, 2024
2 parents f08d0d2 + 44a8eb0 commit b54c659
Show file tree
Hide file tree
Showing 14 changed files with 359 additions and 681 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:

env:
VAULT_ADDR: https://vault.eng.aserto.com/
GO_VERSION: "1.20"
GO_LANGCI_LINT_VERSION: "v1.53.3"
GO_VERSION: "1.23"
GO_LANGCI_LINT_VERSION: "v1.61.0"
CONSOLE_VERSION: ${{ inputs.version }}

jobs:
Expand All @@ -24,21 +24,19 @@ jobs:
uses: actions/checkout@v4
-
name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

-
name: Read Configuration
uses: hashicorp/vault-action@v2.5.0
uses: hashicorp/vault-action@v3
id: vault
with:
url: https://vault.eng.aserto.com/
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY;
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
-
name: Setup git
run: |
Expand All @@ -48,15 +46,13 @@ jobs:
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global user.email "[email protected]"
git config --global user.name "Aserto Bot"
-
name: Update static files
run: |
go run mage.go fetch
make fetch
-
name: Push updated console
run: |
git add .
git commit -m "update console static files"
git push
git push
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/go.work.sum
/cover.out
.ext/*
.dev/*
157 changes: 157 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration

run:
timeout: 5m

linters-settings:
depguard:
list-type: blacklist
packages:
# logging is allowed only by zerolog
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: "logging is allowed only by zerolog"
dupl:
threshold: 100
funlen:
lines: 100
statements: 80
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 18
goimports:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
gomnd:
checks:
- argument
- case
- condition
- return
ignored-numbers:
ignored-files:
ignored-functions:
govet:
shadow: true
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
maligned:
suggest-new: true
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- asciicheck
- bodyclose
- copyloopvar
- dogsled
- errcheck
- exhaustive
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- godot
# - goerr113 # temporary disabled
- gofmt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- noctx
# - rowserrcheck # disable https://github.com/golangci/golangci-lint/issues/2649.
- staticcheck
- stylecheck
- testpackage
- typecheck
- unconvert
- unparam
- unused

# don't enable:
# - depguard
# - dupl
# - gochecknoglobals
# - gocognit
# - godox
# - gomnd
# - lll
# - nestif
# - nolintlint # conflict with 1.19 gofmt changes
# - prealloc
# - revive
# - wsl
# - whitespace

issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- declaration of "(err|ctx)" shadows declaration at
- shadow of imported from 'github.com/stretchr/testify/assert' package 'assert'
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gomnd
# https://github.com/go-critic/go-critic/issues/926
- text: "unnecessaryDefer:"
linters:
- gocritic
- text: "unnamedResult:"
linters:
- gocritic
- path: \.resolvers\.go
text: "typeDefFirst:"
linters:
- gocritic
- path: \.resolvers\.go
text: "paramTypeCombine:"
linters:
- gocritic
- path: \.resolvers\.go
text: "hugeParam:"
linters:
- gocritic
- text: "G404"
linters:
- gosec

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2022 Aserto Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ The package exposes the ui handlers and the static embedded FS used in Topaz for

The static console files in this repository are based on the [self-hosted-console](https://github.com/orgs/aserto-dev/packages/container/package/self-hosted-console) container.

Use `mage fetch` command to get the console files that are embedded in this module.
Use `make fetch` command to get the console files that are embedded in this module.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module github.com/aserto-dev/go-topaz-ui

go 1.20

require github.com/magefile/mage v1.15.0
go 1.22
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
6 changes: 0 additions & 6 deletions go.work

This file was deleted.

12 changes: 0 additions & 12 deletions mage.go

This file was deleted.

45 changes: 0 additions & 45 deletions magefiles/go.mod

This file was deleted.

Loading

0 comments on commit b54c659

Please sign in to comment.