From 3a1a9408d9be3aba1d0cdc823a84ebc2e0ce1474 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 9 Oct 2024 10:58:05 -0400 Subject: [PATCH] fix Descendants spelling this has proliferated everywhere --- docs/architecture.md | 2 +- internal/addrs/graph.go | 4 +-- internal/addrs/move_endpoint_module.go | 2 +- internal/command/import.go | 2 +- internal/command/jsonconfig/config.go | 4 +-- internal/command/meta_config.go | 4 +-- internal/command/state_meta.go | 2 +- internal/command/test.go | 2 +- internal/configs/config.go | 26 +++++++++---------- internal/configs/config_build.go | 2 +- internal/configs/configload/loader.go | 4 +-- internal/configs/configload/loader_load.go | 2 +- internal/configs/configload/module_mgr.go | 2 +- internal/configs/configschema/implied_type.go | 2 +- internal/configs/doc.go | 2 +- internal/configs/variable_type_hint.go | 2 +- internal/dag/dag.go | 2 +- internal/dag/dag_test.go | 4 +-- internal/initwd/from_module.go | 10 +++---- internal/initwd/from_module_test.go | 2 +- internal/initwd/module_install.go | 6 ++--- .../package-prefix.tf | 2 +- internal/instances/expander.go | 4 +-- internal/lang/blocktoattr/fixup.go | 2 +- internal/lang/globalref/analyzer.go | 2 +- internal/moduledeps/module.go | 14 +++++----- internal/refactoring/move_statement.go | 4 +-- internal/refactoring/move_validate.go | 8 +++--- internal/refactoring/move_validate_test.go | 2 +- internal/refactoring/remove_statement.go | 4 +-- internal/stacks/stackruntime/hooks.go | 2 +- .../stackruntime/internal/stackeval/hooks.go | 2 +- .../stackruntime/internal/stackeval/main.go | 2 +- .../internal/stackeval/validating_test.go | 2 +- internal/states/statefile/marshal_equal.go | 2 +- internal/states/statefile/version4.go | 2 +- internal/terraform/eval_context_builtin.go | 10 +++---- internal/terraform/eval_variable.go | 2 +- internal/terraform/evaluate.go | 12 ++++----- internal/terraform/evaluate_data.go | 2 +- internal/terraform/evaluate_placeholder.go | 4 +-- internal/terraform/evaluate_valid.go | 2 +- internal/terraform/node_resource_destroy.go | 2 +- .../transform_attach_config_resource.go | 2 +- internal/terraform/transform_check_starter.go | 2 +- internal/terraform/transform_config.go | 2 +- internal/terraform/transform_destroy_cbd.go | 18 ++++++------- internal/terraform/transform_destroy_edge.go | 2 +- internal/terraform/transform_diff.go | 2 +- .../transform_ephemeral_resource_close.go | 6 ++--- .../terraform/transform_module_expansion.go | 2 +- .../terraform/transform_orphan_resource.go | 2 +- internal/terraform/transform_provider.go | 2 +- .../terraform/transform_removed_modules.go | 2 +- .../docs/cli/state/resource-addressing.mdx | 2 +- website/docs/internals/json-format.mdx | 6 ++--- .../language/modules/develop/providers.mdx | 2 +- 57 files changed, 114 insertions(+), 114 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 740d319f8f..578b90db05 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -101,7 +101,7 @@ described in a later section. The top-level configuration structure is represented by model types in [package `configs`](http://localhost:8080/github.com/hashicorp/terraform/internal/configs). -A whole configuration (the root module plus all of its descendent modules) +A whole configuration (the root module plus all of its descendant modules) is represented by [`configs.Config`](http://localhost:8080/github.com/hashicorp/terraform/internal/configs#Config). diff --git a/internal/addrs/graph.go b/internal/addrs/graph.go index 2bebe79de1..fee485fd4a 100644 --- a/internal/addrs/graph.go +++ b/internal/addrs/graph.go @@ -138,9 +138,9 @@ func (g DirectedGraph[T]) DirectDependentsOf(addr T) Set[T] { func (g DirectedGraph[T]) TransitiveDependentsOf(addr T) Set[T] { k := addr.UniqueKey() ret := MakeSet[T]() - raw, err := g.g.Descendents(k) + raw, err := g.g.Descendants(k) if err != nil { - // It should be impossible for "Descendents" to fail + // It should be impossible for "Descendants" to fail panic(err) } for otherKI := range raw { diff --git a/internal/addrs/move_endpoint_module.go b/internal/addrs/move_endpoint_module.go index d35ffc61d4..2e1cdcf5bc 100644 --- a/internal/addrs/move_endpoint_module.go +++ b/internal/addrs/move_endpoint_module.go @@ -434,7 +434,7 @@ func (e *MoveEndpointInModule) NestedWithin(other *MoveEndpointInModule) bool { // matchModuleInstancePrefix is an internal helper to decide whether the given // module instance address refers to either the module where the move endpoint -// was declared or some descendent of that module. +// was declared or some descendant of that module. // // If so, it will split the given address into two parts: the "prefix" part // which corresponds with the module where the statement was declared, and diff --git a/internal/command/import.go b/internal/command/import.go index 6bd1b06611..2e5c3eacc4 100644 --- a/internal/command/import.go +++ b/internal/command/import.go @@ -113,7 +113,7 @@ func (c *ImportCommand) Run(args []string) int { // This is to reduce the risk that a typo in the resource address will // import something that Terraform will want to immediately destroy on // the next plan, and generally acts as a reassurance of user intent. - targetConfig := config.DescendentForInstance(addr.Module) + targetConfig := config.DescendantForInstance(addr.Module) if targetConfig == nil { modulePath := addr.Module.String() diags = diags.Append(&hcl.Diagnostic{ diff --git a/internal/command/jsonconfig/config.go b/internal/command/jsonconfig/config.go index a09d886e56..65518a7da9 100644 --- a/internal/command/jsonconfig/config.go +++ b/internal/command/jsonconfig/config.go @@ -520,9 +520,9 @@ func marshalResources(resources map[string]*configs.Resource, schemas *terraform return rs, nil } -// Flatten all resource provider keys in a module and its descendents, such +// Flatten all resource provider keys in a module and its descendants, such // that any resources from providers using a configuration passed through the -// module call have a direct refernce to that provider configuration. +// module call have a direct reference to that provider configuration. func normalizeModuleProviderKeys(m *module, pcs map[string]providerConfig) { for i, r := range m.Resources { if pc, exists := pcs[r.ProviderConfigKey]; exists { diff --git a/internal/command/meta_config.go b/internal/command/meta_config.go index 594560c1a1..922518f7ab 100644 --- a/internal/command/meta_config.go +++ b/internal/command/meta_config.go @@ -36,7 +36,7 @@ func (m *Meta) normalizePath(path string) string { } // loadConfig reads a configuration from the given directory, which should -// contain a root module and have already have any required descendent modules +// contain a root module and have already have any required descendant modules // installed. func (m *Meta) loadConfig(rootDir string) (*configs.Config, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics @@ -177,7 +177,7 @@ func (m *Meta) loadHCLFile(filename string) (hcl.Body, tfdiags.Diagnostics) { } // installModules reads a root module from the given directory and attempts -// recursively to install all of its descendent modules. +// recursively to install all of its descendant modules. // // The given hooks object will be notified of installation progress, which // can then be relayed to the end-user. The uiModuleInstallHooks type in diff --git a/internal/command/state_meta.go b/internal/command/state_meta.go index 4917d03364..0b970ddb3d 100644 --- a/internal/command/state_meta.go +++ b/internal/command/state_meta.go @@ -105,7 +105,7 @@ func (c *StateMeta) lookupResourceInstanceAddr(state *states.State, allowMissing switch addr := targetAddr.(type) { case addrs.ModuleInstance: // Matches all instances within the indicated module and all of its - // descendent modules. + // descendant modules. // found is used to identify cases where the selected module has no // resources, but one or more of its submodules does. diff --git a/internal/command/test.go b/internal/command/test.go index 2449ad38a8..993fce4f23 100644 --- a/internal/command/test.go +++ b/internal/command/test.go @@ -128,7 +128,7 @@ func (c *TestCommand) Run(rawArgs []string) int { } // The specified testing directory must be a relative path, and it must - // point to a directory that is a descendent of the configuration directory. + // point to a directory that is a descendant of the configuration directory. if !filepath.IsLocal(args.TestDirectory) { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, diff --git a/internal/configs/config.go b/internal/configs/config.go index c238f53f5f..19ce6e9f2e 100644 --- a/internal/configs/config.go +++ b/internal/configs/config.go @@ -19,7 +19,7 @@ import ( // A Config is a node in the tree of modules within a configuration. // // The module tree is constructed by following ModuleCall instances recursively -// through the root module transitively into descendent modules. +// through the root module transitively into descendant modules. // // A module tree described in *this* package represents the static tree // represented by configuration. During evaluation a static ModuleNode may @@ -145,7 +145,7 @@ func (c *Config) DeepEach(cb func(c *Config)) { } } -// AllModules returns a slice of all the receiver and all of its descendent +// AllModules returns a slice of all the receiver and all of its descendant // nodes in the module tree, in the same order they would be visited by // DeepEach. func (c *Config) AllModules() []*Config { @@ -156,14 +156,14 @@ func (c *Config) AllModules() []*Config { return ret } -// Descendent returns the descendent config that has the given path beneath +// Descendant returns the descendant config that has the given path beneath // the receiver, or nil if there is no such module. // // The path traverses the static module tree, prior to any expansion to handle // count and for_each arguments. // // An empty path will just return the receiver, and is therefore pointless. -func (c *Config) Descendent(path addrs.Module) *Config { +func (c *Config) Descendant(path addrs.Module) *Config { current := c for _, name := range path { current = current.Children[name] @@ -174,13 +174,13 @@ func (c *Config) Descendent(path addrs.Module) *Config { return current } -// DescendentForInstance is like Descendent except that it accepts a path +// DescendantForInstance is like Descendant except that it accepts a path // to a particular module instance in the dynamic module graph, returning // the node from the static module graph that corresponds to it. // // All instances created by a particular module call share the same // configuration, so the keys within the given path are disregarded. -func (c *Config) DescendentForInstance(path addrs.ModuleInstance) *Config { +func (c *Config) DescendantForInstance(path addrs.ModuleInstance) *Config { current := c for _, step := range path { current = current.Children[step.Name] @@ -200,7 +200,7 @@ func (c *Config) TargetExists(target addrs.Targetable) bool { switch target.AddrType() { case addrs.ConfigResourceAddrType: addr := target.(addrs.ConfigResource) - module := c.Descendent(addr.Module) + module := c.Descendant(addr.Module) if module != nil { return module.Module.ResourceByAddr(addr.Resource) != nil } else { @@ -208,7 +208,7 @@ func (c *Config) TargetExists(target addrs.Targetable) bool { } case addrs.AbsResourceInstanceAddrType: addr := target.(addrs.AbsResourceInstance) - module := c.DescendentForInstance(addr.Module) + module := c.DescendantForInstance(addr.Module) if module != nil { return module.Module.ResourceByAddr(addr.Resource.Resource) != nil } else { @@ -216,16 +216,16 @@ func (c *Config) TargetExists(target addrs.Targetable) bool { } case addrs.AbsResourceAddrType: addr := target.(addrs.AbsResource) - module := c.DescendentForInstance(addr.Module) + module := c.DescendantForInstance(addr.Module) if module != nil { return module.Module.ResourceByAddr(addr.Resource) != nil } else { return false } case addrs.ModuleAddrType: - return c.Descendent(target.(addrs.Module)) != nil + return c.Descendant(target.(addrs.Module)) != nil case addrs.ModuleInstanceAddrType: - return c.DescendentForInstance(target.(addrs.ModuleInstance)) != nil + return c.DescendantForInstance(target.(addrs.ModuleInstance)) != nil default: panic(fmt.Errorf("unrecognized targetable type: %d", target.AddrType())) } @@ -846,9 +846,9 @@ func (c *Config) ResolveAbsProviderAddr(addr addrs.ProviderConfig, inModule addr return addr case addrs.LocalProviderConfig: - // Find the descendent Config that contains the module that this + // Find the descendant Config that contains the module that this // local config belongs to. - mc := c.Descendent(inModule) + mc := c.Descendant(inModule) if mc == nil { panic(fmt.Sprintf("ResolveAbsProviderAddr with non-existent module %s", inModule.String())) } diff --git a/internal/configs/config_build.go b/internal/configs/config_build.go index b96bf5c0b3..d0246f27ef 100644 --- a/internal/configs/config_build.go +++ b/internal/configs/config_build.go @@ -16,7 +16,7 @@ import ( ) // BuildConfig constructs a Config from a root module by loading all of its -// descendent modules via the given ModuleWalker. This function also side loads +// descendant modules via the given ModuleWalker. This function also side loads // and installs any mock data files needed by the testing framework via the // MockDataLoader. // diff --git a/internal/configs/configload/loader.go b/internal/configs/configload/loader.go index 6ad987b7d1..a6c91db0fc 100644 --- a/internal/configs/configload/loader.go +++ b/internal/configs/configload/loader.go @@ -23,7 +23,7 @@ type Loader struct { // parser is used to read configuration parser *configs.Parser - // modules is used to install and locate descendent modules that are + // modules is used to install and locate descendant modules that are // referenced (directly or indirectly) from the root module. modules moduleMgr } @@ -31,7 +31,7 @@ type Loader struct { // Config is used with NewLoader to specify configuration arguments for the // loader. type Config struct { - // ModulesDir is a path to a directory where descendent modules are + // ModulesDir is a path to a directory where descendant modules are // (or should be) installed. (This is usually the // .terraform/modules directory, in the common case where this package // is being loaded from the main Terraform CLI package.) diff --git a/internal/configs/configload/loader_load.go b/internal/configs/configload/loader_load.go index 284d4ccba1..6b66d9f7c0 100644 --- a/internal/configs/configload/loader_load.go +++ b/internal/configs/configload/loader_load.go @@ -14,7 +14,7 @@ import ( // LoadConfig reads the Terraform module in the given directory and uses it as the // root module to build the static module tree that represents a configuration, -// assuming that all required descendent modules have already been installed. +// assuming that all required descendant modules have already been installed. // // If error diagnostics are returned, the returned configuration may be either // nil or incomplete. In the latter case, cautious static analysis is possible diff --git a/internal/configs/configload/module_mgr.go b/internal/configs/configload/module_mgr.go index 7c14f68cd4..238e8d7799 100644 --- a/internal/configs/configload/module_mgr.go +++ b/internal/configs/configload/module_mgr.go @@ -23,7 +23,7 @@ type moduleMgr struct { // abstraction and will always write into the "real" filesystem. CanInstall bool - // Dir is the path where descendent modules are (or will be) installed. + // Dir is the path where descendant modules are (or will be) installed. Dir string // Services is a service discovery client that will be used to find diff --git a/internal/configs/configschema/implied_type.go b/internal/configs/configschema/implied_type.go index 1e3f6140a9..90bd06da15 100644 --- a/internal/configs/configschema/implied_type.go +++ b/internal/configs/configschema/implied_type.go @@ -36,7 +36,7 @@ func (b *Block) specType() cty.Type { } // ContainsSensitive returns true if any of the attributes of the receiving -// block or any of its descendent blocks are marked as sensitive. +// block or any of its descendant blocks are marked as sensitive. // // Blocks themselves cannot be sensitive as a whole -- sensitivity is a // per-attribute idea -- but sometimes we want to include a whole object diff --git a/internal/configs/doc.go b/internal/configs/doc.go index 3f8a105ce2..e17d1d6ddb 100644 --- a/internal/configs/doc.go +++ b/internal/configs/doc.go @@ -17,6 +17,6 @@ // // The Parser type is the main entry-point into this package. The LoadConfigDir // method can be used to load a single module directory, and then a full -// configuration (including any descendent modules) can be produced using +// configuration (including any descendant modules) can be produced using // the top-level BuildConfig method. package configs diff --git a/internal/configs/variable_type_hint.go b/internal/configs/variable_type_hint.go index 9190c526bd..59556874dd 100644 --- a/internal/configs/variable_type_hint.go +++ b/internal/configs/variable_type_hint.go @@ -28,7 +28,7 @@ type VariableTypeHint rune // ambiguous contexts will be treated as literal strings, as if TypeHintString // were selected, but no runtime value checks will be applied. This is reasonable // type hint for a module that is never intended to be used at the top-level -// of a configuration, since descendent modules never receive values from +// of a configuration, since descendant modules never receive values from // ambiguous contexts. const TypeHintNone VariableTypeHint = 0 diff --git a/internal/dag/dag.go b/internal/dag/dag.go index 7323b4ffba..85ed0db91e 100644 --- a/internal/dag/dag.go +++ b/internal/dag/dag.go @@ -53,7 +53,7 @@ func (g *AcyclicGraph) Ancestors(vs ...Vertex) (Set, error) { // Returns a Set that includes every Vertex yielded by walking up from the // provided starting Vertex v. -func (g *AcyclicGraph) Descendents(vs ...Vertex) (Set, error) { +func (g *AcyclicGraph) Descendants(vs ...Vertex) (Set, error) { s := make(Set) memoFunc := func(v Vertex, d int) error { s.Add(v) diff --git a/internal/dag/dag_test.go b/internal/dag/dag_test.go index 451bb4e14b..04cc4a25f0 100644 --- a/internal/dag/dag_test.go +++ b/internal/dag/dag_test.go @@ -259,7 +259,7 @@ func TestAcyclicGraphAncestors(t *testing.T) { } } -func TestAcyclicGraphDescendents(t *testing.T) { +func TestAcyclicGraphDescendants(t *testing.T) { var g AcyclicGraph g.Add(1) g.Add(2) @@ -272,7 +272,7 @@ func TestAcyclicGraphDescendents(t *testing.T) { g.Connect(BasicEdge(3, 4)) g.Connect(BasicEdge(4, 5)) - actual, err := g.Descendents(2) + actual, err := g.Descendants(2) if err != nil { t.Fatalf("err: %#v", err) } diff --git a/internal/initwd/from_module.go b/internal/initwd/from_module.go index 4df738ef12..7d54943dd1 100644 --- a/internal/initwd/from_module.go +++ b/internal/initwd/from_module.go @@ -33,7 +33,7 @@ const initFromModuleRootKeyPrefix = initFromModuleRootCallName + "." // DirFromModule populates the given directory (which must exist and be // empty) with the contents of the module at the given source address. // -// It does this by installing the given module and all of its descendent +// It does this by installing the given module and all of its descendant // modules in a temporary root directory and then copying the installed // files into suitable locations. As a consequence, any diagnostics it // generates will reveal the location of this temporary directory to the @@ -43,7 +43,7 @@ const initFromModuleRootKeyPrefix = initFromModuleRootCallName + "." // installation proceeds in a manner identical to normal module installation. // // If the given source address specifies a sub-directory of the given -// package then only the sub-directory and its descendents will be copied +// package then only the sub-directory and its descendants will be copied // into the given root directory, which will cause any relative module // references using ../ from that module to be unresolvable. Error diagnostics // are produced in that case, to prompt the user to rewrite the source strings @@ -167,7 +167,7 @@ func DirFromModule(ctx context.Context, loader *configload.Loader, rootDir, modu fetcher := getmodules.NewPackageFetcher() walker := inst.moduleInstallWalker(ctx, instManifest, true, wrapHooks, fetcher) - _, cDiags := inst.installDescendentModules(fakeRootModule, instManifest, walker, true) + _, cDiags := inst.installDescendantModules(fakeRootModule, instManifest, walker, true) if cDiags.HasErrors() { return diags.Append(cDiags) } @@ -252,7 +252,7 @@ func DirFromModule(ctx context.Context, loader *configload.Loader, rootDir, modu if !strings.HasPrefix(record.Key, initFromModuleRootKeyPrefix) { // Ignore the *real* root module, whose key is empty, since // we're only interested in the module named "root" and its - // descendents. + // descendants. continue } @@ -352,7 +352,7 @@ func DirFromModule(ctx context.Context, loader *configload.Loader, rootDir, modu if err != nil { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, - "Failed to copy descendent module", + "Failed to copy descendant module", fmt.Sprintf("Error copying module %q from %s to %s: %s.", newKey, tempPath, rootDir, err), )) continue diff --git a/internal/initwd/from_module_test.go b/internal/initwd/from_module_test.go index 90349f38cb..1e22598327 100644 --- a/internal/initwd/from_module_test.go +++ b/internal/initwd/from_module_test.go @@ -50,7 +50,7 @@ func TestDirFromModule_registry(t *testing.T) { wantCalls := []testInstallHookCall{ // The module specified to populate the root directory is not mentioned - // here, because the hook mechanism is defined to talk about descendent + // here, because the hook mechanism is defined to talk about descendant // modules only and so a caller to InitDirFromModule is expected to // produce its own user-facing announcement about the root module being // installed. diff --git a/internal/initwd/module_install.go b/internal/initwd/module_install.go index fbcfc0774a..6599c770b8 100644 --- a/internal/initwd/module_install.go +++ b/internal/initwd/module_install.go @@ -137,7 +137,7 @@ func (i *ModuleInstaller) InstallModules(ctx context.Context, rootDir, testsDir } walker := i.moduleInstallWalker(ctx, manifest, upgrade, hooks, fetcher) - cfg, instDiags := i.installDescendentModules(rootMod, manifest, walker, installErrsOnly) + cfg, instDiags := i.installDescendantModules(rootMod, manifest, walker, installErrsOnly) diags = append(diags, instDiags...) return cfg, diags @@ -202,7 +202,7 @@ func (i *ModuleInstaller) moduleInstallWalker(ctx context.Context, manifest mods log.Printf("[TRACE] ModuleInstaller: discarding previous record of %s prior to reinstall", key) } delete(manifest, key) - // Deleting a module invalidates all of its descendent modules too. + // Deleting a module invalidates all of its descendant modules too. keyPrefix := key + "." for subKey := range manifest { if strings.HasPrefix(subKey, keyPrefix) { @@ -292,7 +292,7 @@ func (i *ModuleInstaller) moduleInstallWalker(ctx context.Context, manifest mods ) } -func (i *ModuleInstaller) installDescendentModules(rootMod *configs.Module, manifest modsdir.Manifest, installWalker configs.ModuleWalker, installErrsOnly bool) (*configs.Config, tfdiags.Diagnostics) { +func (i *ModuleInstaller) installDescendantModules(rootMod *configs.Module, manifest modsdir.Manifest, installWalker configs.ModuleWalker, installErrsOnly bool) (*configs.Config, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics // When attempting to initialize the current directory with a module diff --git a/internal/initwd/testdata/load-module-package-prefix/package-prefix.tf b/internal/initwd/testdata/load-module-package-prefix/package-prefix.tf index 08d5ced602..8ba0d28f35 100644 --- a/internal/initwd/testdata/load-module-package-prefix/package-prefix.tf +++ b/internal/initwd/testdata/load-module-package-prefix/package-prefix.tf @@ -8,7 +8,7 @@ module "child" { # # Note that we're intentionally using the special // delimiter to # tell Terraform that it should treat the "package" directory as a - # whole as a module package, with all of its descendents "downloaded" + # whole as a module package, with all of its descendants "downloaded" # (copied) together into ./.terraform/modules/child so that child # can refer to ../grandchild successfully. source = "%%BASE%%/package//child" diff --git a/internal/instances/expander.go b/internal/instances/expander.go index aab8393705..a8f440560a 100644 --- a/internal/instances/expander.go +++ b/internal/instances/expander.go @@ -555,7 +555,7 @@ type expanderModule struct { resources map[addrs.Resource]expansion childInstances map[addrs.ModuleInstanceStep]*expanderModule - // overrides ensures that any overriden modules instances will not be + // overrides ensures that any overridden modules instances will not be // returned as options for expansion. A nil overrides indicates there are // no overrides and we're not operating within the testing framework. overrides *mocking.Overrides @@ -678,7 +678,7 @@ func (m *expanderModule) partialExpandedModuleInstances(addr addrs.Module, paren } // If this step already has everything expanded then we need to - // search inside it to see if it has any unexpanded descendents. + // search inside it to see if it has any unexpanded descendants. if len(addr) > 1 { for step, inst := range m.childInstances { if step.Name != callName { diff --git a/internal/lang/blocktoattr/fixup.go b/internal/lang/blocktoattr/fixup.go index 9084e29e4c..6a6e0ef03d 100644 --- a/internal/lang/blocktoattr/fixup.go +++ b/internal/lang/blocktoattr/fixup.go @@ -207,7 +207,7 @@ type fixupBlocksExpr struct { func (e *fixupBlocksExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { // In order to produce a suitable value for our expression we need to - // now decode the whole descendent block structure under each of our block + // now decode the whole descendant block structure under each of our block // bodies. // // That requires us to do something rather strange: we must construct a diff --git a/internal/lang/globalref/analyzer.go b/internal/lang/globalref/analyzer.go index 289b05b154..90a66cbaae 100644 --- a/internal/lang/globalref/analyzer.go +++ b/internal/lang/globalref/analyzer.go @@ -63,7 +63,7 @@ func NewAnalyzer(cfg *configs.Config, providerSchemas map[addrs.Provider]provide // ModuleConfig retrieves a module configuration from the configuration the // analyzer belongs to, or nil if there is no module with the given address. func (a *Analyzer) ModuleConfig(addr addrs.ModuleInstance) *configs.Module { - modCfg := a.cfg.DescendentForInstance(addr) + modCfg := a.cfg.DescendantForInstance(addr) if modCfg == nil { return nil } diff --git a/internal/moduledeps/module.go b/internal/moduledeps/module.go index fa132b1cac..18605dc557 100644 --- a/internal/moduledeps/module.go +++ b/internal/moduledeps/module.go @@ -23,7 +23,7 @@ type Module struct { type WalkFunc func(path []string, parent *Module, current *Module) error // WalkTree calls the given callback once for the receiver and then -// once for each descendent, in an order such that parents are called +// once for each descendant, in an order such that parents are called // before their children and siblings are called in the order they // appear in the Children slice. // @@ -42,7 +42,7 @@ type WalkFunc func(path []string, parent *Module, current *Module) error // data structure, so it's the caller's responsibility to arrange for that // should it be needed. // -// It is safe for a callback to modify the descendents of the "current" +// It is safe for a callback to modify the descendants of the "current" // module, including the ordering of the Children slice itself, but the // callback MUST NOT modify the parent module. func (m *Module) WalkTree(cb WalkFunc) error { @@ -74,9 +74,9 @@ func (m *Module) SortChildren() { sort.Sort(sortModules{m.Children}) } -// SortDescendents is a convenience wrapper for calling SortChildren on -// the receiver and all of its descendent modules. -func (m *Module) SortDescendents() { +// SortDescendants is a convenience wrapper for calling SortChildren on +// the receiver and all of its descendant modules. +func (m *Module) SortDescendants() { m.WalkTree(func(path []string, parent *Module, current *Module) error { current.SortChildren() return nil @@ -126,7 +126,7 @@ func (m *Module) ProviderRequirements() discovery.PluginRequirements { } // AllProviderRequirements calls ProviderRequirements for the receiver and all -// of its descendents, and merges the result into a single PluginRequirements +// of its descendants, and merges the result into a single PluginRequirements // structure that would satisfy all of the modules together. // // Requirements returned by this method include only version constraints, @@ -145,7 +145,7 @@ func (m *Module) AllProviderRequirements() discovery.PluginRequirements { // the equality of all downstream modules too. // // The children are considered to be ordered, so callers may wish to use -// SortDescendents first to normalize the order of the slices of child nodes. +// SortDescendants first to normalize the order of the slices of child nodes. // // The implementation of this function is not optimized since it is provided // primarily for use in tests. diff --git a/internal/refactoring/move_statement.go b/internal/refactoring/move_statement.go index eec12bffc4..46aa5b6991 100644 --- a/internal/refactoring/move_statement.go +++ b/internal/refactoring/move_statement.go @@ -68,7 +68,7 @@ func findMoveStatements(cfg *configs.Config, into []MoveStatement) []MoveStateme // Only attach providers if we are moving resources, and we attach // the to resource provider from the config. We can retrieve the // from resource provider from the state later. - modCfg := cfg.Descendent(toResource.Module) + modCfg := cfg.Descendant(toResource.Module) // It's possible that multiple refactorings have left a moved block // that points to a module which no longer exists. This may also be // a mistake, but the user will see the unexpected deletion in the @@ -180,7 +180,7 @@ func impliedMoveStatements(cfg *configs.Config, prevRunState *states.State, expl // zero as the one to retain. if !haveMoveStatementForResource(rAddr, explicitStmts) { - resource := cfg.Descendent(addrs.RootModule).Module.ResourceByAddr(rAddr.Resource) + resource := cfg.Descendant(addrs.RootModule).Module.ResourceByAddr(rAddr.Resource) provider := &addrs.AbsProviderConfig{ Module: rAddr.Module.Module(), Provider: resource.Provider, diff --git a/internal/refactoring/move_validate.go b/internal/refactoring/move_validate.go index 67187e4e9d..6953ef2dfc 100644 --- a/internal/refactoring/move_validate.go +++ b/internal/refactoring/move_validate.go @@ -250,7 +250,7 @@ func movableObjectDeclRange(addr addrs.AbsMoveable, cfg *configs.Config) (tfdiag // (NOTE: This assumes "addr" can never be the root module instance, // because the root module is never moveable.) parentAddr, callAddr := addr.Call() - modCfg := cfg.DescendentForInstance(parentAddr) + modCfg := cfg.DescendantForInstance(parentAddr) if modCfg == nil { return tfdiags.SourceRange{}, false } @@ -271,7 +271,7 @@ func movableObjectDeclRange(addr addrs.AbsMoveable, cfg *configs.Config) (tfdiag return tfdiags.SourceRangeFromHCL(call.DeclRange), true } case addrs.AbsModuleCall: - modCfg := cfg.DescendentForInstance(addr.Module) + modCfg := cfg.DescendantForInstance(addr.Module) if modCfg == nil { return tfdiags.SourceRange{}, false } @@ -281,7 +281,7 @@ func movableObjectDeclRange(addr addrs.AbsMoveable, cfg *configs.Config) (tfdiag } return tfdiags.SourceRangeFromHCL(call.DeclRange), true case addrs.AbsResourceInstance: - modCfg := cfg.DescendentForInstance(addr.Module) + modCfg := cfg.DescendantForInstance(addr.Module) if modCfg == nil { return tfdiags.SourceRange{}, false } @@ -302,7 +302,7 @@ func movableObjectDeclRange(addr addrs.AbsMoveable, cfg *configs.Config) (tfdiag return tfdiags.SourceRangeFromHCL(rc.DeclRange), true } case addrs.AbsResource: - modCfg := cfg.DescendentForInstance(addr.Module) + modCfg := cfg.DescendantForInstance(addr.Module) if modCfg == nil { return tfdiags.SourceRange{}, false } diff --git a/internal/refactoring/move_validate_test.go b/internal/refactoring/move_validate_test.go index 8d7b298dc7..0eba52e7cf 100644 --- a/internal/refactoring/move_validate_test.go +++ b/internal/refactoring/move_validate_test.go @@ -544,7 +544,7 @@ func loadRefactoringFixture(t *testing.T, dir string) (*configs.Config, instance func staticPopulateExpanderModule(t *testing.T, rootCfg *configs.Config, moduleAddr addrs.ModuleInstance, expander *instances.Expander) { t.Helper() - modCfg := rootCfg.DescendentForInstance(moduleAddr) + modCfg := rootCfg.DescendantForInstance(moduleAddr) if modCfg == nil { t.Fatalf("no configuration for %s", moduleAddr) } diff --git a/internal/refactoring/remove_statement.go b/internal/refactoring/remove_statement.go index 094ffbb578..94f2e3f392 100644 --- a/internal/refactoring/remove_statement.go +++ b/internal/refactoring/remove_statement.go @@ -43,7 +43,7 @@ func validateRemoveStatements(cfg *configs.Config, stmts addrs.Map[addrs.ConfigM for _, rst := range stmts.Keys() { switch rst := rst.(type) { case addrs.ConfigResource: - m := cfg.Descendent(rst.Module) + m := cfg.Descendant(rst.Module) if m == nil { break } @@ -57,7 +57,7 @@ func validateRemoveStatements(cfg *configs.Config, stmts addrs.Map[addrs.ConfigM }) } case addrs.Module: - if m := cfg.Descendent(rst); m != nil { + if m := cfg.Descendant(rst); m != nil { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Removed module still exists", diff --git a/internal/stacks/stackruntime/hooks.go b/internal/stacks/stackruntime/hooks.go index f330108f4a..a80a08f0f9 100644 --- a/internal/stacks/stackruntime/hooks.go +++ b/internal/stacks/stackruntime/hooks.go @@ -41,7 +41,7 @@ type Hooks = stackeval.Hooks // ContextWithHooks returns a context that carries the given [Hooks] as // one of its values. // -// Pass the resulting context -- or a descendent that preserves the values -- +// Pass the resulting context -- or a descendant that preserves the values -- // to [Plan] or [Apply] to be notified when the different hookable events // occur during that plan or apply process. func ContextWithHooks(parent context.Context, hooks *Hooks) context.Context { diff --git a/internal/stacks/stackruntime/internal/stackeval/hooks.go b/internal/stacks/stackruntime/internal/stackeval/hooks.go index d387fc6511..e67d5bd853 100644 --- a/internal/stacks/stackruntime/internal/stackeval/hooks.go +++ b/internal/stacks/stackruntime/internal/stackeval/hooks.go @@ -192,7 +192,7 @@ type hookSeq struct { // calls that are related to whatever multi-step operation this hook sequence // represents, so that the hook subscriber can use this mechanism to propagate // distributed tracing spans to downstream operations. Callers MUST also use -// descendents of the resulting context for any subsequent calls to +// descendants of the resulting context for any subsequent calls to // [runHookBegin] using the returned [hookSeq]. func hookBegin[Msg any](ctx context.Context, cb hooks.BeginFunc[Msg], ctxCb hooks.ContextAttachFunc, msg Msg) (*hookSeq, context.Context) { tracking := runHookBegin(ctx, cb, msg) diff --git a/internal/stacks/stackruntime/internal/stackeval/main.go b/internal/stacks/stackruntime/internal/stackeval/main.go index dd763256fd..f661e59b4b 100644 --- a/internal/stacks/stackruntime/internal/stackeval/main.go +++ b/internal/stacks/stackruntime/internal/stackeval/main.go @@ -559,7 +559,7 @@ func (m *Main) ResolveAbsExpressionReference(ctx context.Context, ref stackaddrs // // This is intended for cleaning up any resources that would not naturally // be cleaned up as a result of garbage-collecting the [Main] object and its -// many descendents. +// many descendants. // // The context passed to a callback function may be already cancelled by the // time the callback is running, if the cleanup is running in response to diff --git a/internal/stacks/stackruntime/internal/stackeval/validating_test.go b/internal/stacks/stackruntime/internal/stackeval/validating_test.go index 29b65122c2..d2863044b0 100644 --- a/internal/stacks/stackruntime/internal/stackeval/validating_test.go +++ b/internal/stacks/stackruntime/internal/stackeval/validating_test.go @@ -53,7 +53,7 @@ func TestValidate_modulesWithProviderConfigs(t *testing.T) { var wantDiags tfdiags.Diagnostics // Configurations in the root module get a different detail message - // than those in descendent modules, because for descendents we don't + // than those in descendant modules, because for descendants we don't // assume that the author is empowered to make the module // stacks-compatible, while for the root it's more likely to be // directly intended for stacks use, at least for now while things are diff --git a/internal/states/statefile/marshal_equal.go b/internal/states/statefile/marshal_equal.go index c54fbaab51..5184df6e35 100644 --- a/internal/states/statefile/marshal_equal.go +++ b/internal/states/statefile/marshal_equal.go @@ -14,7 +14,7 @@ import ( // // This function compares only the portions of the state that are persisted // in state files, so for example it will not return false if the only -// differences between the two states are local values or descendent module +// differences between the two states are local values or descendant module // outputs. func StatesMarshalEqual(a, b *states.State) bool { var aBuf bytes.Buffer diff --git a/internal/states/statefile/version4.go b/internal/states/statefile/version4.go index 518f8fb9ec..6477e66cf2 100644 --- a/internal/states/statefile/version4.go +++ b/internal/states/statefile/version4.go @@ -248,7 +248,7 @@ func prepareStateV4(sV4 *stateV4) (*File, tfdiags.Diagnostics) { } // The root module is special in that we persist its attributes and thus - // need to reload them now. (For descendent modules we just re-calculate + // need to reload them now. (For descendant modules we just re-calculate // them based on the latest configuration on each run.) { for name, fos := range sV4.RootOutputs { diff --git a/internal/terraform/eval_context_builtin.go b/internal/terraform/eval_context_builtin.go index 2376d32961..10b73cbc03 100644 --- a/internal/terraform/eval_context_builtin.go +++ b/internal/terraform/eval_context_builtin.go @@ -360,7 +360,7 @@ func (ctx *BuiltinEvalContext) EvaluateReplaceTriggeredBy(expr hcl.Expression, r } // Do some validation to make sure we are expecting a change at all - cfg := ctx.Evaluator.Config.Descendent(ctx.Path().Module()) + cfg := ctx.Evaluator.Config.Descendant(ctx.Path().Module()) resCfg := cfg.Module.ResourceByAddr(resourceAddr) if resCfg == nil { diags = diags.Append(&hcl.Diagnostic{ @@ -441,7 +441,7 @@ func (ctx *BuiltinEvalContext) EvaluationScope(self addrs.Referenceable, source // package itself works. The nil check here is for robustness in // incompletely-mocked testing situations; mc should never be nil in // real situations. - if mc := ctx.Evaluator.Config.DescendentForInstance(scope.Addr); mc != nil { + if mc := ctx.Evaluator.Config.DescendantForInstance(scope.Addr); mc != nil { evalScope.SetActiveExperiments(mc.Module.ActiveExperiments) } return evalScope @@ -457,7 +457,7 @@ func (ctx *BuiltinEvalContext) EvaluationScope(self addrs.Referenceable, source Operation: ctx.Evaluator.Operation, } evalScope := ctx.Evaluator.Scope(data, self, source, ctx.evaluationExternalFunctions()) - if mc := ctx.Evaluator.Config.Descendent(scope.Addr.Module()); mc != nil { + if mc := ctx.Evaluator.Config.Descendant(scope.Addr.Module()); mc != nil { evalScope.SetActiveExperiments(mc.Module.ActiveExperiments) } return evalScope @@ -479,7 +479,7 @@ func (ctx *BuiltinEvalContext) evaluationExternalFunctions() lang.ExternalFuncs // by the module author. ret := lang.ExternalFuncs{} - cfg := ctx.Evaluator.Config.Descendent(ctx.scope.evalContextScopeModule()) + cfg := ctx.Evaluator.Config.Descendant(ctx.scope.evalContextScopeModule()) if cfg == nil { // It's weird to not have a configuration by this point, but we'll // tolerate it for robustness and just return no functions at all. @@ -558,7 +558,7 @@ func (ctx *BuiltinEvalContext) LanguageExperimentActive(experiment experiments.E // is module-scoped. return false } - cfg := ctx.Evaluator.Config.Descendent(scope.evalContextScopeModule()) + cfg := ctx.Evaluator.Config.Descendant(scope.evalContextScopeModule()) if cfg == nil { return false } diff --git a/internal/terraform/eval_variable.go b/internal/terraform/eval_variable.go index 57dfe66c11..1cb427f01e 100644 --- a/internal/terraform/eval_variable.go +++ b/internal/terraform/eval_variable.go @@ -227,7 +227,7 @@ func prepareFinalInputVariableValue(addr addrs.AbsInputVariableInstance, raw *In // // This must be used only after any side-effects that make the value of the // variable available for use in expression evaluation, such as -// EvalModuleCallArgument for variables in descendent modules. +// EvalModuleCallArgument for variables in descendant modules. func evalVariableValidations(addr addrs.AbsInputVariableInstance, ctx EvalContext, rules []*configs.CheckRule, valueRng hcl.Range, validateWalk bool) (diags tfdiags.Diagnostics) { if len(rules) == 0 { log.Printf("[TRACE] evalVariableValidations: no validation rules declared for %s, so skipping", addr) diff --git a/internal/terraform/evaluate.go b/internal/terraform/evaluate.go index a42e7dbf00..82779e7c20 100644 --- a/internal/terraform/evaluate.go +++ b/internal/terraform/evaluate.go @@ -236,7 +236,7 @@ func (d *evaluationStateData) GetInputVariable(addr addrs.InputVariable, rng tfd // First we'll make sure the requested value is declared in configuration, // so we can produce a nice message if not. - moduleConfig := d.Evaluator.Config.DescendentForInstance(d.ModulePath) + moduleConfig := d.Evaluator.Config.DescendantForInstance(d.ModulePath) if moduleConfig == nil { // should never happen, since we can't be evaluating in a module // that wasn't mentioned in configuration. @@ -309,7 +309,7 @@ func (d *evaluationStateData) GetLocalValue(addr addrs.LocalValue, rng tfdiags.S // First we'll make sure the requested value is declared in configuration, // so we can produce a nice message if not. - moduleConfig := d.Evaluator.Config.DescendentForInstance(d.ModulePath) + moduleConfig := d.Evaluator.Config.DescendantForInstance(d.ModulePath) if moduleConfig == nil { // should never happen, since we can't be evaluating in a module // that wasn't mentioned in configuration. @@ -348,7 +348,7 @@ func (d *evaluationStateData) GetModule(addr addrs.ModuleCall, rng tfdiags.Sourc moduleAddr := d.ModulePath.Module().Child(addr.Name) absAddr := addr.Absolute(d.ModulePath) - parentCfg := d.Evaluator.Config.DescendentForInstance(d.ModulePath) + parentCfg := d.Evaluator.Config.DescendantForInstance(d.ModulePath) callConfig, ok := parentCfg.Module.ModuleCalls[addr.Name] if !ok { diags = diags.Append(&hcl.Diagnostic{ @@ -363,7 +363,7 @@ func (d *evaluationStateData) GetModule(addr addrs.ModuleCall, rng tfdiags.Sourc // We'll consult the configuration to see what output names we are // expecting, so we can ensure the resulting object is of the expected // type even if our data is incomplete for some reason. - moduleConfig := d.Evaluator.Config.Descendent(moduleAddr) + moduleConfig := d.Evaluator.Config.Descendant(moduleAddr) if moduleConfig == nil { // should never happen, since we have a valid module call above, this // should be caught during static validation. @@ -498,7 +498,7 @@ func (d *evaluationStateData) GetResource(addr addrs.Resource, rng tfdiags.Sourc // First we'll consult the configuration to see if an resource of this // name is declared at all. moduleAddr := d.ModulePath - moduleConfig := d.Evaluator.Config.DescendentForInstance(moduleAddr) + moduleConfig := d.Evaluator.Config.DescendantForInstance(moduleAddr) if moduleConfig == nil { // should never happen, since we can't be evaluating in a module // that wasn't mentioned in configuration. @@ -900,7 +900,7 @@ func (d *evaluationStateData) GetOutput(addr addrs.OutputValue, rng tfdiags.Sour // First we'll make sure the requested value is declared in configuration, // so we can produce a nice message if not. - moduleConfig := d.Evaluator.Config.DescendentForInstance(d.ModulePath) + moduleConfig := d.Evaluator.Config.DescendantForInstance(d.ModulePath) if moduleConfig == nil { // should never happen, since we can't be evaluating in a module // that wasn't mentioned in configuration. diff --git a/internal/terraform/evaluate_data.go b/internal/terraform/evaluate_data.go index 21732f3e3d..1ba113f334 100644 --- a/internal/terraform/evaluate_data.go +++ b/internal/terraform/evaluate_data.go @@ -69,7 +69,7 @@ func (d *evaluationData) GetPathAttr(addr addrs.PathAttr, rng tfdiags.SourceRang return cty.StringVal(filepath.ToSlash(wd)), diags case "module": - moduleConfig := d.Evaluator.Config.Descendent(d.Module) + moduleConfig := d.Evaluator.Config.Descendant(d.Module) if moduleConfig == nil { // should never happen, since we can't be evaluating in a module // that wasn't mentioned in configuration. diff --git a/internal/terraform/evaluate_placeholder.go b/internal/terraform/evaluate_placeholder.go index d087665b26..620b64cece 100644 --- a/internal/terraform/evaluate_placeholder.go +++ b/internal/terraform/evaluate_placeholder.go @@ -155,7 +155,7 @@ func (d *evaluationPlaceholderData) GetModule(addr addrs.ModuleCall, rng tfdiags return cty.DynamicVal, diags } - callerCfg := d.Evaluator.Config.Descendent(d.ModulePath.Module()) + callerCfg := d.Evaluator.Config.Descendant(d.ModulePath.Module()) if callerCfg == nil { // Strange! The above StaticValidateReference should've failed if // the module we're in isn't even declared. But we'll just tolerate @@ -184,7 +184,7 @@ func (d *evaluationPlaceholderData) GetModule(addr addrs.ModuleCall, rng tfdiags // the child module's declared output values represented, which could // then potentially allow detecting a downstream error referring to // an output value that doesn't actually exist. - calledCfg := d.Evaluator.Config.Descendent(d.ModulePath.Module().Child(addr.Name)) + calledCfg := d.Evaluator.Config.Descendant(d.ModulePath.Module().Child(addr.Name)) if calledCfg == nil { // This suggests that the config wasn't constructed correctly, since // there should always be a child config node for any module call, diff --git a/internal/terraform/evaluate_valid.go b/internal/terraform/evaluate_valid.go index 402ec2b7e3..4af1fa2b15 100644 --- a/internal/terraform/evaluate_valid.go +++ b/internal/terraform/evaluate_valid.go @@ -41,7 +41,7 @@ func (e *Evaluator) StaticValidateReferences(refs []*addrs.Reference, modAddr ad } func (e *Evaluator) StaticValidateReference(ref *addrs.Reference, modAddr addrs.Module, self addrs.Referenceable, source addrs.Referenceable) tfdiags.Diagnostics { - modCfg := e.Config.Descendent(modAddr) + modCfg := e.Config.Descendant(modAddr) if modCfg == nil { // This is a bug in the caller rather than a problem with the // reference, but rather than crashing out here in an unhelpful way diff --git a/internal/terraform/node_resource_destroy.go b/internal/terraform/node_resource_destroy.go index 166d50cd60..5e037a4aaf 100644 --- a/internal/terraform/node_resource_destroy.go +++ b/internal/terraform/node_resource_destroy.go @@ -57,7 +57,7 @@ func (n *NodeDestroyResourceInstance) DestroyAddr() *addrs.AbsResourceInstance { func (n *NodeDestroyResourceInstance) CreateBeforeDestroy() bool { // State takes precedence during destroy. // If the resource was removed, there is no config to check. - // If CBD was forced from descendent, it should be saved in the state + // If CBD was forced from descendant, it should be saved in the state // already. if s := n.instanceState; s != nil { if s.Current != nil { diff --git a/internal/terraform/transform_attach_config_resource.go b/internal/terraform/transform_attach_config_resource.go index 9ef259f0e8..2436e3a044 100644 --- a/internal/terraform/transform_attach_config_resource.go +++ b/internal/terraform/transform_attach_config_resource.go @@ -69,7 +69,7 @@ func (t *AttachResourceConfigTransformer) Transform(g *Graph) error { } // Get the configuration. - config := t.Config.Descendent(addr.Module) + config := t.Config.Descendant(addr.Module) if config == nil { log.Printf("[TRACE] AttachResourceConfigTransformer: %q (%T) has no configuration available", dag.VertexName(v), v) diff --git a/internal/terraform/transform_check_starter.go b/internal/terraform/transform_check_starter.go index b4c318c1bd..44b2b0b7b7 100644 --- a/internal/terraform/transform_check_starter.go +++ b/internal/terraform/transform_check_starter.go @@ -76,7 +76,7 @@ func (s *checkStartTransformer) Transform(graph *Graph) error { config := s.Config if !addr.Module.IsRoot() { - config = s.Config.Descendent(addr.Module.Module()) + config = s.Config.Descendant(addr.Module.Module()) } if config == nil { // might have been deleted, so it won't be subject to any checks diff --git a/internal/terraform/transform_config.go b/internal/terraform/transform_config.go index c080c003c8..86678235cb 100644 --- a/internal/terraform/transform_config.go +++ b/internal/terraform/transform_config.go @@ -215,7 +215,7 @@ func (t *ConfigTransformer) validateImportTargets() error { toResource = i.LegacyAddr.ConfigResource() } - moduleCfg := t.Config.Root.Descendent(toResource.Module) + moduleCfg := t.Config.Root.Descendant(toResource.Module) if moduleCfg == nil { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, diff --git a/internal/terraform/transform_destroy_cbd.go b/internal/terraform/transform_destroy_cbd.go index aa4e143e1d..c1644a7c24 100644 --- a/internal/terraform/transform_destroy_cbd.go +++ b/internal/terraform/transform_destroy_cbd.go @@ -45,14 +45,14 @@ func (t *ForcedCBDTransformer) Transform(g *Graph) error { } if !dn.CreateBeforeDestroy() { - // If there are no CBD decendent (dependent nodes), then we + // If there are no CBD decendant (dependent nodes), then we // do nothing here. - if !t.hasCBDDescendent(g, v) { - log.Printf("[TRACE] ForcedCBDTransformer: %q (%T) has no CBD descendent, so skipping", dag.VertexName(v), v) + if !t.hasCBDDescendant(g, v) { + log.Printf("[TRACE] ForcedCBDTransformer: %q (%T) has no CBD descendant, so skipping", dag.VertexName(v), v) continue } - // If this isn't naturally a CBD node, this means that an descendent is + // If this isn't naturally a CBD node, this means that an descendant is // and we need to auto-upgrade this node to CBD. We do this because // a CBD node depending on non-CBD will result in cycles. To avoid this, // we always attempt to upgrade it. @@ -71,10 +71,10 @@ func (t *ForcedCBDTransformer) Transform(g *Graph) error { return nil } -// hasCBDDescendent returns true if any descendent (node that depends on this) +// hasCBDDescendant returns true if any descendant (node that depends on this) // has CBD set. -func (t *ForcedCBDTransformer) hasCBDDescendent(g *Graph, v dag.Vertex) bool { - s, _ := g.Descendents(v) +func (t *ForcedCBDTransformer) hasCBDDescendant(g *Graph, v dag.Vertex) bool { + s, _ := g.Descendants(v) if s == nil { return true } @@ -86,8 +86,8 @@ func (t *ForcedCBDTransformer) hasCBDDescendent(g *Graph, v dag.Vertex) bool { } if dn.CreateBeforeDestroy() { - // some descendent is CreateBeforeDestroy, so we need to follow suit - log.Printf("[TRACE] ForcedCBDTransformer: %q has CBD descendent %q", dag.VertexName(v), dag.VertexName(ov)) + // some descendant is CreateBeforeDestroy, so we need to follow suit + log.Printf("[TRACE] ForcedCBDTransformer: %q has CBD descendant %q", dag.VertexName(v), dag.VertexName(ov)) return true } } diff --git a/internal/terraform/transform_destroy_edge.go b/internal/terraform/transform_destroy_edge.go index 83838c10c1..293f5535e3 100644 --- a/internal/terraform/transform_destroy_edge.go +++ b/internal/terraform/transform_destroy_edge.go @@ -378,7 +378,7 @@ func (t *pruneUnusedNodesTransformer) Transform(g *Graph) error { // earlier, however there may be more to prune now based on // targeting or a destroy with no related instances in the // state. - des, _ := g.Descendents(n) + des, _ := g.Descendants(n) for _, v := range des { switch v.(type) { case GraphNodeProviderConsumer: diff --git a/internal/terraform/transform_diff.go b/internal/terraform/transform_diff.go index 5bbcbf1b51..90df9a9d86 100644 --- a/internal/terraform/transform_diff.go +++ b/internal/terraform/transform_diff.go @@ -32,7 +32,7 @@ func (t *DiffTransformer) hasConfigConditions(addr addrs.AbsResourceInstance) bo return false } - cfg := t.Config.DescendentForInstance(addr.Module) + cfg := t.Config.DescendantForInstance(addr.Module) if cfg == nil { return false } diff --git a/internal/terraform/transform_ephemeral_resource_close.go b/internal/terraform/transform_ephemeral_resource_close.go index cae2e1dfec..df53da7a37 100644 --- a/internal/terraform/transform_ephemeral_resource_close.go +++ b/internal/terraform/transform_ephemeral_resource_close.go @@ -51,11 +51,11 @@ func (t *ephemeralResourceCloseTransformer) Transform(g *Graph) error { // dependents of that resource. Rather than connect directly to them all // however, we'll only connect to leaf nodes by finding those that have // no up edges. - descendents, _ := g.Descendents(v) + descendants, _ := g.Descendants(v) // FIXME: some of these graph methods still return unused errors. It - // would be nice to be able to use Descendents as a range argument for + // would be nice to be able to use Descendants as a range argument for // example. - for _, des := range descendents { + for _, des := range descendants { // We want something which is both a referencer and has no incoming // edges from referencers. While it wouldn't be incorrect to just // check for all leaf nodes, we are trying to connect to the end of diff --git a/internal/terraform/transform_module_expansion.go b/internal/terraform/transform_module_expansion.go index e11305d520..4dd2eb2354 100644 --- a/internal/terraform/transform_module_expansion.go +++ b/internal/terraform/transform_module_expansion.go @@ -32,7 +32,7 @@ type ModuleExpansionTransformer struct { func (t *ModuleExpansionTransformer) Transform(g *Graph) error { t.closers = make(map[string]*nodeCloseModule) // The root module is always a singleton and so does not need expansion - // processing, but any descendent modules do. We'll process them + // processing, but any descendant modules do. We'll process them // recursively using t.transform. for _, cfg := range t.Config.Children { err := t.transform(g, cfg, nil) diff --git a/internal/terraform/transform_orphan_resource.go b/internal/terraform/transform_orphan_resource.go index 8d9fa4eeff..0d9a6bb0a3 100644 --- a/internal/terraform/transform_orphan_resource.go +++ b/internal/terraform/transform_orphan_resource.go @@ -71,7 +71,7 @@ func (t *OrphanResourceInstanceTransformer) transform(g *Graph, ms *states.Modul // nil if the module was removed from the configuration. This is okay, // this just means that every resource is an orphan. var m *configs.Module - if c := t.Config.DescendentForInstance(moduleAddr); c != nil { + if c := t.Config.DescendantForInstance(moduleAddr); c != nil { m = c.Module } diff --git a/internal/terraform/transform_provider.go b/internal/terraform/transform_provider.go index 8bff6a98d4..477a3f927e 100644 --- a/internal/terraform/transform_provider.go +++ b/internal/terraform/transform_provider.go @@ -741,7 +741,7 @@ func (t *ProviderConfigTransformer) attachProviderConfigs(g *Graph) error { addr := apn.ProviderAddr() // Get the configuration. - mc := t.Config.Descendent(addr.Module) + mc := t.Config.Descendant(addr.Module) if mc == nil { log.Printf("[TRACE] ProviderConfigTransformer: no configuration available for %s", addr.String()) continue diff --git a/internal/terraform/transform_removed_modules.go b/internal/terraform/transform_removed_modules.go index f1617e85a5..e19b0f8648 100644 --- a/internal/terraform/transform_removed_modules.go +++ b/internal/terraform/transform_removed_modules.go @@ -27,7 +27,7 @@ func (t *RemovedModuleTransformer) Transform(g *Graph) error { removed := map[string]addrs.Module{} for _, m := range t.State.Modules { - cc := t.Config.DescendentForInstance(m.Addr) + cc := t.Config.DescendantForInstance(m.Addr) if cc != nil { continue } diff --git a/website/docs/cli/state/resource-addressing.mdx b/website/docs/cli/state/resource-addressing.mdx index 788b1a4976..48e3609a65 100644 --- a/website/docs/cli/state/resource-addressing.mdx +++ b/website/docs/cli/state/resource-addressing.mdx @@ -71,7 +71,7 @@ resource_type.resource_name[instance index] -> In Terraform v0.12 and later, a resource spec without a module path prefix matches only resources in the root module. In earlier versions, a resource spec without a module path prefix would match resources with the same type and name -in any descendent module. +in any descendant module. ## Index values for Modules and Resources diff --git a/website/docs/internals/json-format.mdx b/website/docs/internals/json-format.mdx index 441774eded..d4cedf2c12 100644 --- a/website/docs/internals/json-format.mdx +++ b/website/docs/internals/json-format.mdx @@ -272,7 +272,7 @@ The following example illustrates the structure of a ``: ```javascript { // "outputs" describes the outputs from the root module. Outputs from - // descendent modules are not available because they are not retained in all + // descendant modules are not available because they are not retained in all // of the underlying structures we will build this values representation from. "outputs": { "private_ip": { @@ -404,7 +404,7 @@ Because the configuration models are produced at a stage prior to expression eva "alias": "foo", // "module_address" is included only for provider configurations that are - // declared in a descendent module, and gives the opaque address for the + // declared in a descendant module, and gives the opaque address for the // module that contains the provider configuration. "module_address": "module.child", @@ -416,7 +416,7 @@ Because the configuration models are produced at a stage prior to expression eva }, // "root_module" describes the root module in the configuration, and serves - // as the root of a tree of similar objects describing descendent modules. + // as the root of a tree of similar objects describing descendant modules. "root_module": { // "outputs" describes the output value configurations in the module. diff --git a/website/docs/language/modules/develop/providers.mdx b/website/docs/language/modules/develop/providers.mdx index f503855e42..6b4a7594cd 100644 --- a/website/docs/language/modules/develop/providers.mdx +++ b/website/docs/language/modules/develop/providers.mdx @@ -17,7 +17,7 @@ Terraform, are global to an entire Terraform configuration and can be shared across module boundaries. Provider configurations can be defined only in a root Terraform module. -Providers can be passed down to descendent modules in two ways: either +Providers can be passed down to descendant modules in two ways: either _implicitly_ through inheritance, or _explicitly_ via the `providers` argument within a `module` block. These two options are discussed in more detail in the following sections.