15 Commits

Author SHA1 Message Date
Christian Mesh
aaed9f83e4 Fix linting in internal/command (#2798)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-15 07:39:11 -04:00
Christian Mesh
ae542df787 Tune .golangci.yml and fix small lint
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-09 14:14:53 -04:00
Tyler Auerbeck
ca72604301 Update golangci-lint to v2
Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
2025-05-09 14:14:53 -04:00
Christian Mesh
b2bf39802a Implement the first part of RFC 20250303-linter-policy (#2577)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-03-10 13:16:27 -04:00
Martin Atkins
620b449533 Prepare for upgrade to golangci-lint v1.64.5
In a future commit we will adopt golangci-lint v1.64.5, which now triggers
lint warnings for some code that was previously not detected. This commit
is the smallest change to address those differences.

Unfortunately the "cloud" package and the "remote" backend both rely on
non-idiomatic error message formatting because they emit the returned error
message text directly into the UI, so to avoid changing the UI output but
also avoid significant refactoring this just adds nolint comments to those
for now. A future commit might address this by reworking things so that
the UI takes care of its own presentation concerns instead of relying on
the main implementation to directly generate UI-appropriate error strings.

This also completely disables the exportloopref linter, because that was
for a loop scoping hazard that was already addressed by a language change
in Go 1.22. This linter is therefore completely removed in newer versions
of golangci-lint and would thus generate an error if left enabled after
upgrading.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-02-26 11:33:43 -08:00
Martin Atkins
ad32bde2ae Temporarily disable the complexity-related lint rules
We're intending to gradually improve all of the existing functions that
fail these checks as a separate project from other work, because fixing
for these particular lint rules tends to be too invasive to be safe or
sensible to combine with other work.

Therefore we'll temporarily disable these lints from the main lint run
and add a separate .golangci-complexity.yml that we can use to track our
progress towards eliminating those lint failures without continuing to
litter the code with nolint comments in the meantime.

This also removes all of the existing nolint comments for these linters so
that we can start fresh and review each one as part of our improvement
project.

We'll re-enable these linters (and remove .golangci-complexity.yml) once
each example has either been rewritten to pass the checks or we've
concluded that further decomposition would hurt readability and so added
"nolint" comments back in so we can review whether our lint rules are too
strict once we've got a bunch of examples to consider together.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-03 10:41:05 -05:00
Christian Mesh
ece1bb4f49 Fix data provider iteration destroy (#2270)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-09 07:56:58 -05:00
Christian Mesh
fd775f0fe3 Implement Provider for_each (#2105)
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
Co-authored-by: ollevche <ollevche@gmail.com>
Co-authored-by: Ronny Orot <ronny.orot@gmail.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2024-11-05 18:08:23 -05:00
Arel Rabinowitz
3d4bf29c56 Add exclude flag support (#1900)
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2024-11-05 10:16:00 -05:00
Christian Mesh
7cacb9f066 Fix function refs in variable validation (#2052)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-10-17 12:37:54 -04:00
Christian Mesh
3c45c30249 Move varhcl (body variable inspection) into hcl fork (#1919)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-08-23 10:01:07 -04:00
Ronny Orot
ab289fc07c OpenTofu Specific Code Override: Add support to .tofu files (#1738)
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
2024-06-24 16:10:35 +03:00
Oleksandr Levchenkov
5a161c8bcc add automated copyright header check (#1696)
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: Oleksandr Levchenkov <ollevche@gmail.com>
2024-06-03 16:49:36 +03:00
Oleksandr Levchenkov
f2ee7a3c8f lower golangci-lint requirements (#1654)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-05-21 08:34:09 -04:00
Janos
dd5f9afe89 Coding standards (#1423)
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Co-authored-by: James Humphries <james@james-humphries.co.uk>
Co-authored-by: Oleksandr Levchenkov <ollevche@gmail.com>
2024-05-13 11:39:46 +02:00