mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
ipaddr: Exempt from all lint rules
The code in this package is all snapshot from the Go codebase in older versions, inlined here to allow OpenTofu's cidr-calculation-related functions to preserve their original behavior despite upstream changing the parsing rules in a breaking way. This code is intentionally modified as little as possible from the upstream code it was derived from. We are imposing on ourselves considerably stricter style conventions than the Go project follows and so we need to disable various linters for this package to allow this code to remain written in the Go idiomatic style, rather than in OpenTofu's stricter local style. In particular, we've chosen to prohibit ourselves from using named return values or package-global variables, despite those both being typical in the standard library and in other codebases. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
This commit is contained in:
parent
ad32bde2ae
commit
9d9c1486fa
@ -10,6 +10,7 @@
|
||||
// This library accepts either size of byte slice but always
|
||||
// returns 16-byte addresses.
|
||||
|
||||
//nolint:cyclop,funlen,gochecknoglobals,gocritic,nonamedreturns,mnd // This file is copied from the Go codebase and intended to remain close to the original in case we need to backport changes.
|
||||
package ipaddr
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//nolint:gochecknoglobals,gocritic,govet // This file is copied from the Go codebase and intended to remain close to the original in case we need to backport changes.
|
||||
package ipaddr
|
||||
|
||||
import (
|
||||
|
@ -5,6 +5,7 @@
|
||||
// Simple file i/o and string manipulation, to avoid
|
||||
// depending on strconv and bufio and strings.
|
||||
|
||||
//nolint:nonamedreturns,mnd // This file is copied from the Go codebase and intended to remain close to the original in case we need to backport changes.
|
||||
package ipaddr
|
||||
|
||||
// Bigger than we need, not too big to worry about overflow
|
||||
|
Loading…
Reference in New Issue
Block a user