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

Update build tags, lint entire repo for Linux #1968

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

helsaawy
Copy link
Contributor

Add (Windows) build tags to necessary files, and add internal\vhdx\doc.go so that go language server does not complain that package is missing on Linux.

Not all updated files are Windows specific; some (eg, internal\gcs\iochannel.go) contain un-exported code that is only used in Windows-specific code. In those cases, the //go:build windows tag prevents unused lint errors when GOOS=linux.

Export the parseAnnotations(Uint32|Uint64|String) functions in internal\oci\annotations.go since other functions in the file are used in Linux files and that was the only way to avoid unused lint errors.

Update the lint (in .github\workflows\ci.yml) and codeql (in .github\workflows\codeql.yml) jobs to run on entire repo for Linux, rather than in a specific set directories.

@helsaawy helsaawy requested a review from a team as a code owner November 13, 2023 18:55
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@helsaawy helsaawy force-pushed the linux-tags branch 2 times, most recently from b80bd98 to 8b6524a Compare November 13, 2023 19:25
Add (Windows) build tags to necessary files, and add
`internal\vhdx\doc.go` so that go language server does not complain that
package is missing on Linux.

Not all updated files are Windows specific. Some (eg,
`internal\gcs\iochannel.go`) are only used by Windows code, so the go
build tag prevents `unused` lint errors when `GOOS=linux`.

Export the `parseAnnotations(Uint32|Uint64|String)` functions in
`internal\oci\annotations.go` since other functions in the
file are used in Linux files and that was the only way to avoid `unused`
lint errors.

Finally updated lint (in `.github\workflows\ci.yml`) and codeql
(in `.github\workflows\codeql.yml`) jobs to run on entire repo for
Linux, rather then specific directories.

Signed-off-by: Hamza El-Saawy <[email protected]>
@helsaawy helsaawy merged commit 522ec33 into microsoft:main Nov 13, 2023
18 of 19 checks passed
@helsaawy helsaawy deleted the linux-tags branch November 13, 2023 21:13
princepereira pushed a commit to princepereira/hcsshim that referenced this pull request Aug 29, 2024
Add (Windows) build tags to necessary files, and add
`internal\vhdx\doc.go` so that go language server does not complain that
package is missing on Linux.

Not all updated files are Windows specific. Some (eg,
`internal\gcs\iochannel.go`) are only used by Windows code, so the go
build tag prevents `unused` lint errors when `GOOS=linux`.

Export the `parseAnnotations(Uint32|Uint64|String)` functions in
`internal\oci\annotations.go` since other functions in the
file are used in Linux files and that was the only way to avoid `unused`
lint errors.

Finally updated lint (in `.github\workflows\ci.yml`) and codeql
(in `.github\workflows\codeql.yml`) jobs to run on entire repo for
Linux, rather then specific directories.

Signed-off-by: Hamza El-Saawy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants