- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: format code by gofumpt #982
Conversation
https://github.com/mvdan/gofumpt ```sh git ls-files | grep -E "\.go$" | xargs gofumpt -l -s -w ```
📝 WalkthroughPull Request AnalysisWalkthroughThis pull request encompasses a comprehensive set of changes across multiple files in the Atmos project, focusing primarily on syntactical improvements, variable declaration refinements, and minor error handling modifications. The changes span various packages and include updates to file permission representations, import statements, and code organization. The modifications are predominantly stylistic and do not significantly alter the core functionality of the codebase. Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
With these changes, we march towards a more polished and consistent codebase! 🛡️ While not a monumental shift, these updates enhance our syntax and organization, making our code easier to read and maintain. Let's keep the momentum going! 💪 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
📝 WalkthroughWalkthroughThis pull request encompasses a comprehensive set of changes across multiple files in the Atmos project, focusing primarily on code style improvements, syntax modernization, and minor refactoring. The modifications span variable declarations, error handling, file permission representations, and import statement organization. The changes do not introduce significant functional alterations but aim to enhance code readability, consistency, and align with modern Go coding practices. Changes
Possibly related PRs
Suggested Labels
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
internal/exec/terraform_clean.go (2)
Line range hint
231-252
: Consider making theme colors configurable.The hardcoded colors (
#FFFDF5
,#5B00FF
) might not be optimal for all terminal themes and color schemes. Consider extracting these into theme configuration variables.- cream := lipgloss.AdaptiveColor{Light: "#FFFDF5", Dark: "#FFFDF5"} - purple := lipgloss.AdaptiveColor{Light: "#5B00FF", Dark: "#5B00FF"} + cream := theme.Colors.Cream + purple := theme.Colors.Purple
Line range hint
381-476
: Consider breaking down this function for better maintainability.The function is handling multiple responsibilities:
- Path validation and preparation
- File collection
- User confirmation
- Deletion execution
Consider extracting these into separate functions for better maintainability and testability.
Example refactoring structure:
func handleCleanSubCommand(info schema.ConfigAndStacksInfo, componentPath string, atmosConfig schema.AtmosConfiguration) error { if info.SubCommand != "clean" { return nil } cleanPath, relativePath, err := prepareCleanPaths(info, componentPath, atmosConfig) if err != nil { return err } folders, err := collectFilesToDelete(info, cleanPath, atmosConfig) if err != nil { return err } if err := handleUserConfirmation(info, folders, atmosConfig); err != nil { return err } return executeDelete(folders, relativePath, atmosConfig) }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (71)
cmd/cmd_utils.go
(6 hunks)cmd/colored/colored.go
(0 hunks)cmd/describe_config.go
(0 hunks)cmd/describe_stacks.go
(0 hunks)cmd/helmfile_apply.go
(1 hunks)cmd/helmfile_destroy.go
(1 hunks)cmd/helmfile_diff.go
(1 hunks)cmd/helmfile_sync.go
(1 hunks)cmd/root.go
(0 hunks)cmd/validate_editorconfig.go
(1 hunks)go.mod
(1 hunks)internal/exec/atlantis_generate_repo_config.go
(1 hunks)internal/exec/atlantis_utils.go
(0 hunks)internal/exec/config_sources_utils.go
(0 hunks)internal/exec/describe_affected_utils.go
(0 hunks)internal/exec/describe_dependents.go
(1 hunks)internal/exec/describe_stacks.go
(0 hunks)internal/exec/describe_workflows.go
(1 hunks)internal/exec/file_utils.go
(2 hunks)internal/exec/helmfile.go
(1 hunks)internal/exec/helmfile_generate_varfile.go
(1 hunks)internal/exec/pro.go
(0 hunks)internal/exec/shell_utils.go
(2 hunks)internal/exec/spacelift_utils.go
(0 hunks)internal/exec/stack_processor_utils.go
(2 hunks)internal/exec/stack_utils.go
(0 hunks)internal/exec/template_funcs_component.go
(1 hunks)internal/exec/template_funcs_gomplate_datasource.go
(1 hunks)internal/exec/terraform.go
(3 hunks)internal/exec/terraform_clean.go
(3 hunks)internal/exec/terraform_generate_backend.go
(2 hunks)internal/exec/terraform_generate_backends.go
(2 hunks)internal/exec/terraform_generate_varfile.go
(1 hunks)internal/exec/terraform_generate_varfiles.go
(1 hunks)internal/exec/terraform_outputs.go
(3 hunks)internal/exec/utils.go
(26 hunks)internal/exec/validate_stacks.go
(1 hunks)internal/exec/validate_utils.go
(0 hunks)internal/exec/vendor.go
(1 hunks)internal/exec/vendor_model.go
(1 hunks)internal/exec/vendor_model_component.go
(1 hunks)internal/exec/vendor_utils.go
(0 hunks)internal/exec/workflow_utils.go
(4 hunks)internal/exec/yaml_func_exec.go
(0 hunks)internal/exec/yaml_func_store.go
(0 hunks)internal/exec/yaml_func_template.go
(0 hunks)internal/exec/yaml_func_utils.go
(0 hunks)pkg/aws/aws_eks_update_kubeconfig.go
(0 hunks)pkg/component/component_processor.go
(0 hunks)pkg/config/cache.go
(1 hunks)pkg/config/config.go
(0 hunks)pkg/config/utils.go
(1 hunks)pkg/describe/describe_stacks.go
(0 hunks)pkg/hooks/store.go
(0 hunks)pkg/list/list_workflows_test.go
(6 hunks)pkg/logger/logger.go
(1 hunks)pkg/pro/api_client.go
(0 hunks)pkg/spacelift/spacelift_stack_processor.go
(0 hunks)pkg/spacelift/spacelift_stack_processor_test.go
(2 hunks)pkg/stack/stack_processor_test.go
(1 hunks)pkg/store/artifactory_store.go
(0 hunks)pkg/store/artifactory_store_test.go
(1 hunks)pkg/store/aws_ssm_param_store.go
(0 hunks)pkg/utils/glob_utils.go
(1 hunks)pkg/utils/hcl_utils.go
(1 hunks)pkg/utils/highlight_utils.go
(1 hunks)pkg/utils/log_utils.go
(1 hunks)pkg/utils/version_utils.go
(1 hunks)pkg/utils/yaml_utils.go
(1 hunks)pkg/vender/vendor_config_test.go
(4 hunks)tests/cli_test.go
(2 hunks)
💤 Files with no reviewable changes (26)
- pkg/hooks/store.go
- pkg/aws/aws_eks_update_kubeconfig.go
- internal/exec/atlantis_utils.go
- internal/exec/yaml_func_template.go
- internal/exec/yaml_func_store.go
- internal/exec/yaml_func_utils.go
- pkg/pro/api_client.go
- pkg/config/config.go
- internal/exec/yaml_func_exec.go
- pkg/store/artifactory_store.go
- internal/exec/validate_utils.go
- internal/exec/spacelift_utils.go
- cmd/describe_stacks.go
- pkg/store/aws_ssm_param_store.go
- internal/exec/pro.go
- internal/exec/config_sources_utils.go
- cmd/root.go
- pkg/describe/describe_stacks.go
- internal/exec/stack_utils.go
- pkg/component/component_processor.go
- pkg/spacelift/spacelift_stack_processor.go
- cmd/describe_config.go
- internal/exec/vendor_utils.go
- cmd/colored/colored.go
- internal/exec/describe_stacks.go
- internal/exec/describe_affected_utils.go
✅ Files skipped from review due to trivial changes (32)
- internal/exec/vendor_model.go
- pkg/utils/log_utils.go
- internal/exec/template_funcs_component.go
- pkg/logger/logger.go
- internal/exec/terraform_generate_varfile.go
- pkg/config/cache.go
- internal/exec/helmfile_generate_varfile.go
- pkg/utils/hcl_utils.go
- internal/exec/validate_stacks.go
- pkg/utils/glob_utils.go
- internal/exec/describe_dependents.go
- cmd/validate_editorconfig.go
- internal/exec/template_funcs_gomplate_datasource.go
- internal/exec/terraform_generate_varfiles.go
- internal/exec/vendor.go
- pkg/utils/yaml_utils.go
- internal/exec/terraform_generate_backends.go
- pkg/utils/highlight_utils.go
- internal/exec/vendor_model_component.go
- internal/exec/atlantis_generate_repo_config.go
- internal/exec/helmfile.go
- internal/exec/terraform.go
- internal/exec/terraform_outputs.go
- tests/cli_test.go
- pkg/list/list_workflows_test.go
- internal/exec/terraform_generate_backend.go
- cmd/helmfile_destroy.go
- pkg/spacelift/spacelift_stack_processor_test.go
- pkg/vender/vendor_config_test.go
- internal/exec/shell_utils.go
- pkg/config/utils.go
- internal/exec/utils.go
🧰 Additional context used
📓 Learnings (2)
cmd/cmd_utils.go (2)
Learnt from: samtholiya
PR: cloudposse/atmos#914
File: cmd/root.go:172-178
Timestamp: 2025-01-18T15:18:35.475Z
Learning: The `showUsageAndExit` function in `cmd/cmd_utils.go` provides user feedback by showing error messages, command suggestions, and valid subcommands before terminating the program with `os.Exit(1)`. It never returns to the caller, making error handling unnecessary for calls to this function.
Learnt from: samtholiya
PR: cloudposse/atmos#914
File: cmd/root.go:172-178
Timestamp: 2025-01-18T15:18:35.475Z
Learning: The `showUsageAndExit` function in `cmd/cmd_utils.go` terminates the program with `os.Exit(1)` and never returns to the caller, making error handling unnecessary for calls to this function.
internal/exec/terraform_clean.go (1)
Learnt from: haitham911
PR: cloudposse/atmos#727
File: internal/exec/terraform_clean.go:215-223
Timestamp: 2024-11-12T05:52:05.088Z
Learning: In `internal/exec/terraform_clean.go`, the function `determineCleanPath` is necessary and should not be removed.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Summary
🔇 Additional comments (18)
pkg/store/artifactory_store_test.go (2)
44-44
: LGTM! Modern octal syntax for directory permissions.The update to
0o755
follows modern Go conventions for octal literals while maintaining the standard Unix directory permissions (rwxr-xr-x).
50-50
: LGTM! Modern octal syntax for file permissions.The update to
0o644
follows modern Go conventions for octal literals while maintaining the standard Unix file permissions (rw-r--r--).internal/exec/file_utils.go (1)
45-45
: LGTM! Clean modernization of octal permission notation.The update from
0644
to0o644
follows modern Go conventions for explicit octal notation. This change improves code clarity while maintaining identical functionality. Keep up the good work, warrior! 💪Also applies to: 58-58
cmd/helmfile_diff.go (1)
8-16
: Clean and idiomatic variable grouping!The grouping of related variables within a single
var
block follows Go best practices and improves code organization. The documentation strings are well-formatted and provide clear examples.cmd/helmfile_apply.go (1)
8-16
: Consistent formatting maintained!The variable grouping and documentation format mirror the changes in helmfile_diff.go, maintaining consistency across the codebase.
cmd/helmfile_sync.go (1)
6-14
: Well-structured variable declarations!The formatting changes maintain consistency with other command files, following the same clean pattern of grouped variable declarations.
internal/exec/workflow_utils.go (1)
29-29
: Streamlined variable declarations!The switch to
:=
operator for variable declarations makes the code more concise and idiomatic. The changes maintain functionality while improving readability.Also applies to: 64-65, 80-82, 211-211
pkg/stack/stack_processor_test.go (1)
41-41
: LGTM! Clean variable declaration.The change to use
:=
instead ofvar
makes the code more concise while maintaining readability.cmd/cmd_utils.go (3)
65-65
: LGTM! Clean variable declaration.The change to use
:=
forcustomCommand
improves code conciseness.
135-135
: LGTM! Clean variable declaration.The change to use
:=
foraliasCommand
enhances readability.
Line range hint
173-196
: LGTM! Clean argument validation logic.The argument validation logic is well-structured with clear error messages.
pkg/utils/version_utils.go (1)
21-22
: LGTM! Improved readability.Breaking down the
links
slice initialization into multiple lines enhances code readability.go.mod (1)
58-58
: LGTM! Explicit dependency declaration.Making
golang.org/x/sync
a direct dependency improves dependency management clarity.internal/exec/stack_processor_utils.go (2)
1640-1641
: Function signature update looks consistent.Passing
componentStackMap
here is helpful. Verify if all callers account for this new parameter.
1675-1676
: Function signature update checks out.Adding
stackImports
as a parameter is logical. Ensure all call sites have been updated.internal/exec/describe_workflows.go (1)
5-5
: Import statement reintroduction is fine.The import
u "github.com/cloudposse/atmos/pkg/utils"
is beneficial for evaluating queries. Good addition!internal/exec/terraform_clean.go (2)
Line range hint
346-364
: LGTM! Clean and well-structured implementation.The function effectively handles different scenarios and follows Go best practices.
Line range hint
365-380
: LGTM! Robust security checks implemented.The function implements essential security validations:
- Prevents root directory deletion
- Blocks paths with relative components
- Validates empty values
This helps prevent accidental or malicious deletions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
internal/exec/stack_processor_utils.go (2)
1640-1641
: Add doc references for new parameter
These lines add a new parameter but lack documentation updates. A brief explanation in the function comment aboutcomponentStackMap
would improve clarity.You can update the doc as follows:
-// FindComponentStacks finds all infrastructure stack manifests where the component or the base component is defined +// FindComponentStacks finds all infrastructure stack manifests where the component or the base component is defined. // componentStackMap provides a lookup of known stacks for each component type. func FindComponentStacks( componentType string, component string, baseComponent string, componentStackMap map[string]map[string][]string, ) ([]string, error) {
1675-1676
: Extend doc for new parameter
These lines introduce a new parameterstackImports
that is not mentioned in the function comment. Expand the doc to mention its purpose.Proposed update:
-// FindComponentDependenciesLegacy finds all imports where the component or the base component(s) are defined +// FindComponentDependenciesLegacy finds all imports where the component or the base component(s) are defined. // stackImports holds the imported stack configurations used for determining dependencies. func FindComponentDependenciesLegacy( stack string, componentType string, component string, baseComponents []string, stackImports map[string]map[string]any, ) ([]string, error) {internal/exec/terraform_clean.go (1)
Line range hint
365-379
: LGTM! Robust security checks for data directory.Essential security validations:
- Prevents root directory deletion
- Blocks path traversal attacks
- Validates environment variable
Consider adding these additional security checks:
- Check for symbolic links that might point to sensitive locations
- Validate absolute path doesn't contain sensitive system directories
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (71)
cmd/cmd_utils.go
(6 hunks)cmd/colored/colored.go
(0 hunks)cmd/describe_config.go
(0 hunks)cmd/describe_stacks.go
(0 hunks)cmd/helmfile_apply.go
(1 hunks)cmd/helmfile_destroy.go
(1 hunks)cmd/helmfile_diff.go
(1 hunks)cmd/helmfile_sync.go
(1 hunks)cmd/root.go
(0 hunks)cmd/validate_editorconfig.go
(1 hunks)go.mod
(1 hunks)internal/exec/atlantis_generate_repo_config.go
(1 hunks)internal/exec/atlantis_utils.go
(0 hunks)internal/exec/config_sources_utils.go
(0 hunks)internal/exec/describe_affected_utils.go
(0 hunks)internal/exec/describe_dependents.go
(1 hunks)internal/exec/describe_stacks.go
(0 hunks)internal/exec/describe_workflows.go
(1 hunks)internal/exec/file_utils.go
(2 hunks)internal/exec/helmfile.go
(1 hunks)internal/exec/helmfile_generate_varfile.go
(1 hunks)internal/exec/pro.go
(0 hunks)internal/exec/shell_utils.go
(2 hunks)internal/exec/spacelift_utils.go
(0 hunks)internal/exec/stack_processor_utils.go
(2 hunks)internal/exec/stack_utils.go
(0 hunks)internal/exec/template_funcs_component.go
(1 hunks)internal/exec/template_funcs_gomplate_datasource.go
(1 hunks)internal/exec/terraform.go
(3 hunks)internal/exec/terraform_clean.go
(3 hunks)internal/exec/terraform_generate_backend.go
(2 hunks)internal/exec/terraform_generate_backends.go
(2 hunks)internal/exec/terraform_generate_varfile.go
(1 hunks)internal/exec/terraform_generate_varfiles.go
(1 hunks)internal/exec/terraform_outputs.go
(3 hunks)internal/exec/utils.go
(26 hunks)internal/exec/validate_stacks.go
(1 hunks)internal/exec/validate_utils.go
(0 hunks)internal/exec/vendor.go
(1 hunks)internal/exec/vendor_model.go
(1 hunks)internal/exec/vendor_model_component.go
(1 hunks)internal/exec/vendor_utils.go
(0 hunks)internal/exec/workflow_utils.go
(4 hunks)internal/exec/yaml_func_exec.go
(0 hunks)internal/exec/yaml_func_store.go
(0 hunks)internal/exec/yaml_func_template.go
(0 hunks)internal/exec/yaml_func_utils.go
(0 hunks)pkg/aws/aws_eks_update_kubeconfig.go
(0 hunks)pkg/component/component_processor.go
(0 hunks)pkg/config/cache.go
(1 hunks)pkg/config/config.go
(0 hunks)pkg/config/utils.go
(1 hunks)pkg/describe/describe_stacks.go
(0 hunks)pkg/hooks/store.go
(0 hunks)pkg/list/list_workflows_test.go
(6 hunks)pkg/logger/logger.go
(1 hunks)pkg/pro/api_client.go
(0 hunks)pkg/spacelift/spacelift_stack_processor.go
(0 hunks)pkg/spacelift/spacelift_stack_processor_test.go
(2 hunks)pkg/stack/stack_processor_test.go
(1 hunks)pkg/store/artifactory_store.go
(0 hunks)pkg/store/artifactory_store_test.go
(1 hunks)pkg/store/aws_ssm_param_store.go
(0 hunks)pkg/utils/glob_utils.go
(1 hunks)pkg/utils/hcl_utils.go
(1 hunks)pkg/utils/highlight_utils.go
(1 hunks)pkg/utils/log_utils.go
(1 hunks)pkg/utils/version_utils.go
(1 hunks)pkg/utils/yaml_utils.go
(1 hunks)pkg/vender/vendor_config_test.go
(4 hunks)tests/cli_test.go
(2 hunks)
💤 Files with no reviewable changes (26)
- pkg/hooks/store.go
- pkg/describe/describe_stacks.go
- cmd/root.go
- internal/exec/yaml_func_template.go
- pkg/aws/aws_eks_update_kubeconfig.go
- internal/exec/yaml_func_store.go
- internal/exec/yaml_func_utils.go
- internal/exec/pro.go
- cmd/describe_config.go
- pkg/component/component_processor.go
- pkg/store/artifactory_store.go
- pkg/pro/api_client.go
- internal/exec/yaml_func_exec.go
- internal/exec/atlantis_utils.go
- cmd/describe_stacks.go
- pkg/config/config.go
- internal/exec/spacelift_utils.go
- pkg/store/aws_ssm_param_store.go
- internal/exec/vendor_utils.go
- pkg/spacelift/spacelift_stack_processor.go
- internal/exec/describe_affected_utils.go
- cmd/colored/colored.go
- internal/exec/validate_utils.go
- internal/exec/stack_utils.go
- internal/exec/config_sources_utils.go
- internal/exec/describe_stacks.go
✅ Files skipped from review due to trivial changes (31)
- internal/exec/vendor_model.go
- internal/exec/validate_stacks.go
- internal/exec/file_utils.go
- internal/exec/helmfile_generate_varfile.go
- pkg/logger/logger.go
- pkg/utils/highlight_utils.go
- internal/exec/template_funcs_gomplate_datasource.go
- pkg/utils/hcl_utils.go
- internal/exec/vendor.go
- internal/exec/terraform_outputs.go
- pkg/utils/yaml_utils.go
- internal/exec/terraform.go
- internal/exec/atlantis_generate_repo_config.go
- cmd/validate_editorconfig.go
- pkg/utils/glob_utils.go
- internal/exec/workflow_utils.go
- pkg/list/list_workflows_test.go
- internal/exec/describe_dependents.go
- internal/exec/terraform_generate_varfiles.go
- internal/exec/helmfile.go
- cmd/helmfile_destroy.go
- internal/exec/template_funcs_component.go
- internal/exec/terraform_generate_varfile.go
- pkg/utils/log_utils.go
- pkg/config/cache.go
- pkg/vender/vendor_config_test.go
- internal/exec/terraform_generate_backends.go
- internal/exec/vendor_model_component.go
- internal/exec/shell_utils.go
- pkg/spacelift/spacelift_stack_processor_test.go
- internal/exec/utils.go
🧰 Additional context used
📓 Learnings (2)
cmd/cmd_utils.go (2)
Learnt from: samtholiya
PR: cloudposse/atmos#914
File: cmd/root.go:172-178
Timestamp: 2025-01-18T15:18:35.475Z
Learning: The `showUsageAndExit` function in `cmd/cmd_utils.go` provides user feedback by showing error messages, command suggestions, and valid subcommands before terminating the program with `os.Exit(1)`. It never returns to the caller, making error handling unnecessary for calls to this function.
Learnt from: samtholiya
PR: cloudposse/atmos#914
File: cmd/root.go:172-178
Timestamp: 2025-01-18T15:18:35.475Z
Learning: The `showUsageAndExit` function in `cmd/cmd_utils.go` terminates the program with `os.Exit(1)` and never returns to the caller, making error handling unnecessary for calls to this function.
internal/exec/terraform_clean.go (1)
Learnt from: haitham911
PR: cloudposse/atmos#727
File: internal/exec/terraform_clean.go:215-223
Timestamp: 2024-11-12T05:52:05.088Z
Learning: In `internal/exec/terraform_clean.go`, the function `determineCleanPath` is necessary and should not be removed.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Summary
🔇 Additional comments (16)
pkg/store/artifactory_store_test.go (2)
44-44
: LGTM! Modern octal notation for directory permissions.The update to
0o755
follows current Go best practices for representing octal literals. This makes the code more explicit and readable while maintaining the same Unix-style directory permissions (rwxr-xr-x).
50-50
: LGTM! Modern octal notation for file permissions.The update to
0o644
aligns with Go's modern syntax for octal literals. This maintains the same Unix-style file permissions (rw-r--r--) while improving code clarity.pkg/utils/version_utils.go (1)
21-22
: Nice improvement to the upgrade message!The addition of the installation link alongside the releases link provides better guidance for users looking to upgrade.
tests/cli_test.go (2)
29-33
: Clean variable grouping!The grouped variable declarations improve code organization and readability.
566-570
: Good use of explicit octal notation!The update to use
0o
prefix for file permissions follows modern Go conventions and makes the code more explicit.cmd/helmfile_diff.go (1)
8-16
: Well done on improving the documentation and code organization!The grouping of related variable declarations in a var block follows Go best practices, and the added example usage in the documentation makes it more user-friendly.
cmd/helmfile_apply.go (1)
8-16
: Excellent consistency in documentation and formatting!The changes maintain the same high-quality pattern seen in helmfile_diff.go, with clear examples and well-organized variable declarations.
cmd/helmfile_sync.go (1)
6-14
: Great job emphasizing the safety aspects in documentation!The changes maintain consistency with other files while adding crucial information about the non-destructive nature of the sync command. This helps prevent potential user mistakes.
internal/exec/describe_workflows.go (1)
5-6
: Clean import organization!The blank line separation and aliased import follow Go's standard formatting practices.
internal/exec/terraform_generate_backend.go (2)
Line range hint
78-83
: LGTM! Idiomatic variable declaration.The change to use
:=
for variable declaration is more idiomatic Go and makes the code more concise.
90-90
: LGTM! Modern octal notation.The change to use
0o644
instead of0644
for file permissions is more explicit and follows modern Go conventions.pkg/stack/stack_processor_test.go (1)
Line range hint
41-50
: LGTM! Idiomatic variable declaration in test.The change to use
:=
for multiple variable declaration is more idiomatic Go and improves readability.internal/exec/terraform_clean.go (2)
Line range hint
231-252
: LGTM! Well-implemented user confirmation dialog.The function provides a good user experience with:
- Clear confirmation message
- Custom styling using Charm UI
- Proper error handling for user abort
Line range hint
346-364
: LGTM! Clean file selection logic.Good separation of concerns with:
- Clear conditional logic for different scenarios
- Proper handling of flags
- Consistent file patterns
cmd/cmd_utils.go (1)
65-65
: LGTM! Consistent variable declaration style.The changes to use
:=
for variable declarations are:
- More idiomatic Go
- Consistent with other files
- Improve code readability
Also applies to: 135-135, 313-313
pkg/config/utils.go (1)
27-27
: LGTM! Clean variable declaration.The change from
var
to:=
follows idiomatic Go style and improves readability.
This is great! All for standardizing formatting. To maintain it, though probably need an a CI validation. Maybe something like this? Like we do with tidy: |
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
aqua.yaml (1)
1-9
: Consider enabling checksum verification for better security.The checksum configuration is currently commented out. Enabling it would add an extra layer of security by verifying package integrity.
-# checksum: -# enabled: true -# require_checksum: true -# supported_envs: -# - all +checksum: + enabled: true + require_checksum: true + supported_envs: + - all.github/workflows/test.yml (1)
79-87
: Consider verifying the aqua installation.While the installation steps are correct, adding a verification step would ensure aqua is properly installed.
- name: Install gofumpt run: | + aqua -v gofumpt -version
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/test.yml
(1 hunks)aqua.yaml
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Build (ubuntu-latest, linux)
- GitHub Check: Analyze (go)
- GitHub Check: Summary
🔇 Additional comments (4)
aqua.yaml (2)
10-12
: LGTM! Registry configuration is properly set up.The standard registry is configured with a specific version, and the Renovate comment is correctly placed for automated updates.
13-14
: LGTM! Package version matches PR requirements.The gofumpt version (v0.7.0) is correctly specified and matches the PR description.
.github/workflows/test.yml (2)
75-78
: LGTM! Job configuration is well structured.The fmt job is properly configured to run on ubuntu-latest, which is appropriate for this task.
88-94
: LGTM! Formatting check is robust and matches PR requirements.The implementation:
- Uses the exact command from PR description
- Properly checks for formatting differences
- Provides clear error message
So we have a lot of open PRs inflight. My concern is if we do this now, it will maybe a painful rebase? Since this is largely an automated PR (meaning low human effort), I am inclined that we first merge some large PRs that are almost ready; or we only do the fmt job as part of this PR and restrict to files modified, and slowly start requiring modified files to be updated. I could be overlooking something here... so leaning on your experience |
Also, what do you think about adding a |
Good point! Thank you for your review. |
💥 This pull request now has conflicts. Could you fix it @suzuki-shunsuke? 🙏 |
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
We can close this pull request if we can merge #991 . |
what
https://github.com/mvdan/gofumpt
why
references
Summary by CodeRabbit
Release Notes
New Features
Improvements
0o
prefix.:=
syntax.Code Maintenance
Testing
These changes focus on improving code quality, maintainability, and developer experience without introducing significant functional changes.