Check index¶
Every check tfsprout ships, grouped by category. Each check ID links to its own page with flagged code, passing code, and suppression examples.
- Standard checks run in both
tfsproutandtfsproutx. - Extra checks — every ID beginning with
X— run only intfsproutx. See Standard vs extra checks.
Prefix meanings are covered in Checks and categories. The Type column records the analysis technique; every check today is AST-based.
Three checks can rewrite your code under -fix: R007, XR007, and XR008. See Automated fixes.
Rows marked REMOVED (tfproviderlint v0.30.0) no longer report anything. Their IDs are retained permanently so existing ignore comments and CI flags keep working — see Removed checks.
For the authoritative description of any check as the running binary sees it:
Standard checks¶
Enabled by default in both commands.
Acceptance test checks¶
Patterns in _test.go files that use helper/resource test harnesses. These are silent under -test=false.
| Check | Description | Type |
|---|---|---|
| AT001 | check for TestCase missing CheckDestroy |
AST |
| AT002 | check for acceptance test function names including the word import | AST |
| AT003 | check for acceptance test function names missing an underscore | AST |
| AT004 | check for TestStep Config containing provider configuration |
AST |
| AT005 | check for acceptance test function names missing TestAcc prefix |
AST |
| AT006 | check for acceptance test functions containing multiple resource.Test() invocations |
AST |
| AT007 | check for acceptance test functions containing multiple resource.ParallelTest() invocations |
AST |
| AT008 | check for acceptance test function declaration *testing.T parameter naming |
AST |
| AT009 | check for acctest.RandStringFromCharSet() calls that can be simplified to acctest.RandString() |
AST |
| AT010 | check for TestCase including IDRefreshName implementation |
AST |
| AT011 | check for TestCase including IDRefreshIgnore implementation without IDRefreshName |
AST |
| AT012 | check for files containing multiple acceptance test function name prefixes | AST |
Resource checks¶
Patterns in schema.Resource definitions and CRUD functions.
| Check | Description | Type |
|---|---|---|
| R001 | check for ResourceData.Set() calls using complex key argument |
AST |
| R002 | check for ResourceData.Set() calls using * dereferences |
AST |
| R003 | check for Resource having Exists functions |
AST |
| R004 | check for ResourceData.Set() calls using incompatible value types |
AST |
| R005 | check for ResourceData.HasChange() calls that can be combined into one HasChanges() call |
AST |
| R006 | check for RetryFunc that omit retryable errors |
AST |
| R007 | check for deprecated (schema.ResourceData).Partial usage |
AST |
| R008 | REMOVED (tfproviderlint v0.30.0) check for deprecated (schema.ResourceData).SetPartial usage |
AST |
| R009 | check for Go panic usage | AST |
| R010 | check for (schema.ResourceData).GetChange assignment which should use (schema.ResourceData).Get |
AST |
| R011 | check for Resource that configure MigrateState |
AST |
| R012 | check for data source Resource that configure CustomizeDiff |
AST |
| R013 | check for map[string]*Resource that resource names contain at least one underscore |
AST |
| R014 | check for CreateFunc, CreateContextFunc, DeleteFunc, DeleteContextFunc, ReadFunc, ReadContextFunc, UpdateFunc, and UpdateContextFunc parameter naming |
AST |
| R015 | check for (*schema.ResourceData).SetId() receiver method usage with unstable resource.UniqueId() value |
AST |
| R016 | check for (*schema.ResourceData).SetId() receiver method usage with unstable resource.PrefixedUniqueId() value |
AST |
| R017 | check for (*schema.ResourceData).SetId() receiver method usage with unstable time.Now() value |
AST |
| R018 | check for time.Sleep() function usage |
AST |
| R019 | check for (*schema.ResourceData).HasChanges() receiver method usage with many arguments |
AST |
Schema checks¶
Patterns in schema.Schema definitions and attribute maps. Several of these catch configurations that fail provider schema validation at runtime.
| Check | Description | Type |
|---|---|---|
| S001 | check for Schema of TypeList or TypeSet missing Elem |
AST |
| S002 | check for Schema with both Required and Optional enabled |
AST |
| S003 | check for Schema with both Required and Computed enabled |
AST |
| S004 | check for Schema with both Required and Default configured |
AST |
| S005 | check for Schema with both Computed and Default configured |
AST |
| S006 | check for Schema of TypeMap missing Elem |
AST |
| S007 | check for Schema with both Required and ConflictsWith configured |
AST |
| S008 | check for Schema of TypeList or TypeSet with Default configured |
AST |
| S009 | check for Schema of TypeList or TypeSet with ValidateFunc or ValidateDiagFunc configured |
AST |
| S010 | check for Schema of Computed only with ValidateFunc configured |
AST |
| S011 | check for Schema of Computed only with DiffSuppressFunc configured |
AST |
| S012 | check for Schema that Type is configured |
AST |
| S013 | check for map[string]*Schema that one of Computed, Optional, or Required is configured |
AST |
| S014 | check for Schema within Elem that Computed, Optional, and Required are not configured |
AST |
| S015 | check for map[string]*Schema that attribute names are valid |
AST |
| S016 | check for Schema that Set is only configured for TypeSet |
AST |
| S017 | check for Schema that MaxItems and MinItems are only configured for TypeList, TypeMap, or TypeSet |
AST |
| S018 | check for Schema that should use TypeList with MaxItems: 1 |
AST |
| S019 | check for Schema that should omit Computed, Optional, or Required set to false |
AST |
| S020 | check for Schema of Computed only with ForceNew enabled |
AST |
| S021 | check for Schema that should omit ComputedWhen |
AST |
| S022 | check for Schema of TypeMap with invalid Elem of *schema.Resource |
AST |
| S023 | check for Schema that should omit Elem with incompatible Type |
AST |
| S024 | check for Schema that should omit ForceNew in data source schema attributes |
AST |
| S025 | check for Schema of Computed only with AtLeastOneOf configured |
AST |
| S026 | check for Schema of Computed only with ConflictsWith configured |
AST |
| S027 | check for Schema of Computed only with Default configured |
AST |
| S028 | check for Schema of Computed only with DefaultFunc configured |
AST |
| S029 | check for Schema of Computed only with ExactlyOneOf configured |
AST |
| S030 | check for Schema of Computed only with InputDefault configured |
AST |
| S031 | check for Schema of Computed only with MaxItems configured |
AST |
| S032 | check for Schema of Computed only with MinItems configured |
AST |
| S033 | check for Schema of Computed only with StateFunc configured |
AST |
| S034 | REMOVED (tfproviderlint v0.30.0) check for Schema that configure PromoteSingle |
AST |
| S035 | check for Schema with invalid AtLeastOneOf attribute references |
AST |
| S036 | check for Schema with invalid ConflictsWith attribute references |
AST |
| S037 | check for Schema with invalid ExactlyOneOf attribute references |
AST |
| S038 | check for Schema with both ValidateFunc and ValidateDiagFunc configured |
AST |
| S039 | check for Schema with invalid resource identity configuration |
AST |
| S040 | check for Schema with only Computed enabled and ValidateDiagFunc configured |
AST |
| S041 | check for Schema with WriteOnly and an incompatible field configured |
AST |
| S042 | check for Schema of TypeList, TypeMap, or TypeSet with WriteOnly enabled |
AST |
| S043 | check for Schema of TypeSet or Computed block containing WriteOnly attributes |
AST |
Validation checks¶
Patterns in SchemaValidateFunc implementations and helper/validation usage. Most report hand-rolled logic that duplicates a built-in validator.
| Check | Description | Type |
|---|---|---|
| V001 | check for custom SchemaValidateFunc that implement validation.StringMatch() or validation.StringDoesNotMatch() |
AST |
| V002 | REMOVED (tfproviderlint v0.30.0) check for deprecated CIDRNetwork validation function usage |
AST |
| V003 | REMOVED (tfproviderlint v0.30.0) check for deprecated IPRange validation function usage |
AST |
| V004 | REMOVED (tfproviderlint v0.30.0) check for deprecated SingleIP validation function usage |
AST |
| V005 | REMOVED (tfproviderlint v0.30.0) check for deprecated ValidateJsonString validation function usage |
AST |
| V006 | REMOVED (tfproviderlint v0.30.0) check for deprecated ValidateListUniqueStrings validation function usage |
AST |
| V007 | REMOVED (tfproviderlint v0.30.0) check for deprecated ValidateRegexp validation function usage |
AST |
| V008 | REMOVED (tfproviderlint v0.30.0) check for deprecated ValidateRFC3339TimeString validation function usage |
AST |
| V009 | check for validation.StringMatch() call with empty message argument |
AST |
| V010 | check for validation.StringDoesNotMatch() call with empty message argument |
AST |
| V011 | check for custom SchemaValidateFunc that implement validation.StringLenBetween() |
AST |
| V012 | check for custom SchemaValidateFunc that implement validation.IntAtLeast(), validation.IntAtMost(), or validation.IntBetween() |
AST |
| V013 | check for custom SchemaValidateFunc that implement validation.StringInSlice() or validation.StringNotInSlice() |
AST |
| V014 | check for custom SchemaValidateFunc that implement validation.IntInSlice() or validation.IntNotInSlice() |
AST |
Extra checks¶
Not included in tfsprout. Access them via tfsproutx, or by building a custom lint tool. These generally represent advanced Terraform Plugin SDK functionality that is not appropriate for every provider.
Extra acceptance test checks¶
| Check | Description | Type |
|---|---|---|
| XAT001 | check for TestCase missing ErrorCheck |
AST |
Extra resource checks¶
| Check | Description | Type |
|---|---|---|
| XR001 | check for usage of ResourceData.GetOkExists() calls |
AST |
| XR002 | check for Resource that should implement Importer |
AST |
| XR003 | check for Resource that should implement Timeouts |
AST |
| XR004 | check for ResourceData.Set() calls that should implement error checking with complex values |
AST |
| XR005 | check for Resource that Description is configured |
AST |
| XR006 | check for Resource that implements Timeouts for missing Create, Delete, Read, or Update implementation |
AST |
| XR007 | check for os/exec.Command usage |
AST |
| XR008 | check for os/exec.CommandContext usage |
AST |
Extra schema checks¶
| Check | Description | Type |
|---|---|---|
| XS001 | check for map[string]*Schema that Description is configured |
AST |
| XS002 | check for map[string]*Schema that keys are in alphabetical order |
AST |