MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Check

Method Check

tools/mage/headers.go:197–223  ·  view source on GitHub ↗

Check checks that all files contain the required file header.

()

Source from the content-addressed store, hash-verified

195
196// Check checks that all files contain the required file header.
197func (h Headers) Check() error {
198 mg.Deps(Headers.loadFile)
199 var checkErrs errorSlice
200 err := filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
201 if info.IsDir() {
202 switch path {
203 case ".cache", ".dev", ".env", ".git", "dist", "node_modules", "public", "sdk/js/dist", "sdk/js/node_modules", "vendor":
204 return filepath.SkipDir
205 }
206 return nil
207 }
208 if selectedFiles != nil && !selectedFiles[path] {
209 return nil
210 }
211 if checkErr := h.check(path); checkErr != nil {
212 checkErrs = append(checkErrs, checkErr)
213 }
214 return nil
215 })
216 if err != nil {
217 return err
218 }
219 if len(checkErrs) > 0 {
220 return checkErrs
221 }
222 return nil
223}
224
225// CheckNewFiles checks that all new files contain the required file header with the correct year.
226func (h Headers) CheckNewFiles() error {

Callers

nothing calls this directly

Calls 2

checkMethod · 0.95
DepsMethod · 0.45

Tested by

no test coverage detected