...
1# Engineering System Checks
2
3* [Build and Test](#build-and-test)
4* [Analyze Stages](#analyze-stages)
5
6## Build and Test
7
8Our build system runs PR changes against the latest two versions of Go on both Windows and Linux.
9
10## Analyze
11
12### Link Verification Check
13Verifies all of the links are valid in your README files. This step also checks that locale codes in links are removed. If this is failing first check if you have locale codes (ie. `en-us`) in your links, then check to see if the link works locally.
14
15If you are trying to add a link that will exist in the next PR (ie. you are adding a samples README or migration guide), you can use an `aka.ms` link or use a temporary link (ie: `https://microsoft.com`) and create a follow-up PR to correct the temporary link.
16
17### Lint
18Some of the most common linting errors are:
19* `errcheck`: An error was returned but it was not checked to be `nil`
20* `varcheck`: A variable is unused
21* `deadcode`: A struct or method is unused
22* `ineffasign`: An ineffectual assignment, the variable is not used after declaration.
23
24For more information about the linters run checkout the [golangci website][golangci_website]
25
26To run this locally, first install the tool with:
27```bash
28go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.41.1
29```
30
31```bash
32golangci-lint run -c <path_to_root>/eng/.golangci.yml in <path_to_my_package>
33```
34
35### Copyright Header Check
36Every source file must have the MIT header comment at the top of the file. At the top of each file you need to include the following snippet and a new line before the package definition:
37```golang
38// Copyright (c) Microsoft Corporation. All rights reserved.
39// Licensed under the MIT License.
40
41package <mypackage>
42```
43
44### Format Check
45Your package should follow the default formatting, which you can run locally with the command:
46```bash
47go fmt
48```
49
50<!-- LINKS -->
51[golangci_website]: https://golangci-lint.run/usage/linters/
View as plain text