containerd / containerd/project-checks

File header checker does not allow multi-line build constraints

Open
#5 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
6
Forks
11
Avg merge
22d 21h
Merged PRs (30d)
1

Description

In https://github.com/containerd/containerd/pull/7033#discussion_r893034728, I suggested a constraint of `//go:build (linux || windows || darwin) && !no_cri`. In the old syntax, that expands to:

```
// +build linux windows darwin
// +build !no_cri
```

When used together for compatibility, this results in a three-line build constraint section prior to the file header:

```
//go:build (linux || windows || darwin) && !no_cri
// +build linux windows darwin
// +build !no_cri
```

This causes the file headers check to fail:

```
2022-06-09T17:02:11.9823766Z ##[group]Run echo "::group::📚 File headers"
2022-06-09T17:02:11.9824087Z echo "::group::📚 File headers"
2022-06-09T17:02:11.9824517Z /home/runner/work/_actions/containerd/project-checks/v1/script/validate/fileheader /home/runner/work/_actions/containerd/project-checks/v1/
2022-06-09T17:02:11.9824914Z echo "::endgroup::"
```
(https://github.com/containerd/containerd/runs/6817382535)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.