Skip to content

Commit

Permalink
fix all linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-savchuk committed Sep 17, 2022
1 parent e67ad82 commit 9781bfb
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DISABLE_LINTERS:
- YAML_YAMLLINT
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
- MARKDOWN_MARKDOWN_LINK_CHECK
FILTER_REGEX_EXCLUDE: (.*testdata/*|install.sh)
FILTER_REGEX_EXCLUDE: (.*testdata/*|install.sh|pkg/container/docker_cli.go)
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.yml
PARALLEL: false
PRINT_ALPACA: false
8 changes: 4 additions & 4 deletions IMAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

**Note: `catthehacker/ubuntu` images are based on Ubuntu root filesystem**

| Image | GitHub Repository |
| -------------------------------------------------------------------- | ------------------------------------------------------------- |
| Image | GitHub Repository |
| ------------------------------------------------------------ | ------------------------------------------------------------- |
| [`catthehacker/ubuntu:act-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`catthehacker/ubuntu:act-22.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`catthehacker/ubuntu:act-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
Expand All @@ -34,8 +34,8 @@
| [`nektos/act-environments-ubuntu:18.04-lite`][hub/nektos/act-environments-ubuntu] | ![`nektos:18.04-lite`][hub/nektos/act-environments-ubuntu/18.04-lite/size] | [`nektos/act-environments`][gh/nektos/act-environments] |
| [`nektos/act-environments-ubuntu:18.04-full`][hub/nektos/act-environments-ubuntu] | ![`nektos:18.04-full`][hub/nektos/act-environments-ubuntu/18.04-full/size] | [`nektos/act-environments`][gh/nektos/act-environments] |

| Image | GitHub Repository |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| Image | GitHub Repository |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [`catthehacker/ubuntu:full-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
| [`catthehacker/ubuntu:full-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
| [`catthehacker/ubuntu:full-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ act -s GITHUB_TOKEN=[insert token or leave blank for secure input]

## Services

Services are not currently supported but are being worked on. See: https://github.com/nektos/act/issues/173
Services are not currently supported but are being worked on. See: [#173](https://github.com/nektos/act/issues/173)

## `MODULE_NOT_FOUND`

Expand Down Expand Up @@ -252,10 +252,10 @@ export DOCKER_HOST=$(docker context inspect --format '{{.Endpoints.docker.Host}}

GitHub Actions offers managed [virtual environments](https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners) for running workflows. In order for `act` to run your workflows locally, it must run a container for the runner defined in your workflow file. Here are the images that `act` uses for each runner type and size:

| GitHub Runner | Micro Docker Image | Medium Docker Image | Large Docker Image |
| --------------- | -------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------- |
| GitHub Runner | Micro Docker Image | Medium Docker Image | Large Docker Image |
| --------------- | -------------------------------- | ------------------------------------------------- | -------------------------------------------------- |
| `ubuntu-latest` | [`node:16-buster-slim`][micro] | [`catthehacker/ubuntu:act-latest`][docker_images] | [`catthehacker/ubuntu:full-latest`][docker_images] |
| `ubuntu-22.04` | [`node:16-bullseye-slim`][micro] | [`catthehacker/ubuntu:act-22.04`][docker_images] | `unavailable` |
| `ubuntu-22.04` | [`node:16-bullseye-slim`][micro] | [`catthehacker/ubuntu:act-22.04`][docker_images] | `unavailable` |
| `ubuntu-20.04` | [`node:16-buster-slim`][micro] | [`catthehacker/ubuntu:act-20.04`][docker_images] | [`catthehacker/ubuntu:full-20.04`][docker_images] |
| `ubuntu-18.04` | [`node:16-buster-slim`][micro] | [`catthehacker/ubuntu:act-18.04`][docker_images] | [`catthehacker/ubuntu:full-18.04`][docker_images] |

Expand Down
3 changes: 2 additions & 1 deletion pkg/common/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ func gitOptions(token string) (fetchOptions git.FetchOptions, pullOptions git.Pu
}

// NewGitCloneExecutor creates an executor to clone git repos
// nolint:gocyclo
//
//nolint:gocyclo
func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor {
return func(ctx context.Context) error {
logger := common.Logger(ctx)
Expand Down
2 changes: 1 addition & 1 deletion pkg/container/docker_cli.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// nolint: unparam
//nolint:unparam,errcheck,depguard,deadcode,unused
package container

// exact copy of https://github.com/docker/cli/blob/9ac8584acfd501c3f4da0e845e3a40ed15c85041/cli/command/container/opts.go
Expand Down
2 changes: 1 addition & 1 deletion pkg/container/file_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (*defaultFs) Readlink(path string) (string, error) {
return os.Readlink(path)
}

// nolint: gocyclo
//nolint:gocyclo
func (fc *fileCollector) collectFiles(ctx context.Context, submodulePath []string) filepath.WalkFunc {
i, _ := fc.Fs.OpenGitIndex(path.Join(fc.SrcPath, path.Join(submodulePath...)))
return func(file string, fi os.FileInfo, err error) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/exprparser/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ func (impl *interperterImpl) evaluateLogicalCompare(compareNode *actionlint.Logi
return nil, fmt.Errorf("Unable to compare incompatibles types '%s' and '%s'", leftValue.Kind(), rightValue.Kind())
}

// nolint:gocyclo
//nolint:gocyclo
func (impl *interperterImpl) evaluateFuncCall(funcCallNode *actionlint.FuncCallNode) (interface{}, error) {
args := make([]reflect.Value, 0)

Expand Down
3 changes: 2 additions & 1 deletion pkg/model/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ type WorkflowFiles struct {
}

// NewWorkflowPlanner will load a specific workflow, all workflows from a directory or all workflows from a directory and its subdirectories
// nolint: gocyclo
//
//nolint:gocyclo
func NewWorkflowPlanner(path string, noWorkflowRecurse bool) (WorkflowPlanner, error) {
path, err := filepath.Abs(path)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/model/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ func (j *Job) Matrix() map[string][]interface{} {

// GetMatrixes returns the matrix cross product
// It skips includes and hard fails excludes for non-existing keys
// nolint:gocyclo
//
//nolint:gocyclo
func (j *Job) GetMatrixes() []map[string]interface{} {
matrixes := make([]map[string]interface{}, 0)
if j.Strategy != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/runner/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ func removeGitIgnore(ctx context.Context, directory string) error {
}

// TODO: break out parts of function to reduce complexicity
// nolint:gocyclo
//
//nolint:gocyclo
func execAsDocker(ctx context.Context, step actionStep, actionName string, basedir string, localAction bool) error {
logger := common.Logger(ctx)
rc := step.getRunContext()
Expand Down
1 change: 1 addition & 0 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func New(runnerConfig *Config) (Runner, error) {
}

// NewPlanExecutor ...
//
//nolint:gocyclo
func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
maxJobNameLen := 0
Expand Down

0 comments on commit 9781bfb

Please sign in to comment.