Skip to content

feat: add linter configs to the os sync task #26

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

Merged
merged 3 commits into from
Jun 13, 2025

Conversation

westonplatter
Copy link
Member

@westonplatter westonplatter commented Jun 13, 2025

what

Summary by CodeRabbit

  • Chores
    • Updated the default set of modules to target only one specific module.
    • Expanded the list of configuration files included in synchronization tasks.
    • Improved comments and ignore patterns for project-specific directories.

@westonplatter westonplatter requested a review from a team as a code owner June 13, 2025 19:41
Copy link

coderabbitai bot commented Jun 13, 2025

Walkthrough

This change updates the .gitignore file to add a rule for ignoring the .claude directory, along with a clarifying comment regarding responsibility for code generation tools. In lib/os-modules/Taskfile.yaml, the DEFAULT_MODULES variable is reduced to only include terraform-googleworkspace-users-groups-automation. The list of files synchronized by the sync task is expanded to include .tflint.hcl, .checkov.yaml, .yamllint.yaml, and .markdownlint.yaml. A minor formatting adjustment is also made to the sync task's output message.

Possibly related PRs

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch feat/add-linter-dotfiles
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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)
lib/os-modules/Taskfile.yaml (2)

5-5: Simplify DEFAULT_MODULES definition

Since there’s only one default module, you can replace the multiline block with a single-line string to improve readability:

- DEFAULT_MODULES: |
-   terraform-googleworkspace-users-groups-automation
+ DEFAULT_MODULES: terraform-googleworkspace-users-groups-automation

32-35: Add existence check before syncing

To avoid rsync failures when a file is missing in the template, insert a pre-sync guard:

if [ ! -e "{{.SHARED_TMP_DIR}}/$file" ]; then
  echo "⚠️  Skipping missing $file"
  continue
fi

This makes the sync task more robust.

.gitignore (1)

3-5: Fix typos and improve ignore pattern

There are minor spelling mistakes and the directory ignore can be simplified:

- # Claude Code - we beleive engineers are responsible for the code they push no matter how it's generated.
+ # Claude Code - we believe engineers are responsible for the code they push no matter how it's generated.
- # Therefore, configs specific to their coding practices are their responsibilty to judiciously manage.
+ # Therefore, configs specific to their coding practices are their responsibility to judiciously manage.
- .claude/*
+ .claude/

This ensures the .claude folder itself is ignored and the comments read clearly.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2238455 and 9b45e8d.

📒 Files selected for processing (2)
  • .gitignore (1 hunks)
  • lib/os-modules/Taskfile.yaml (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.yaml`: You are well-versed in writing and reviewing YAML configurations for the Task tool (https://taskfile.dev/). Provide recommendations for clarity, maintainability, and a...

**/*.yaml: You are well-versed in writing and reviewing YAML configurations for the Task tool (https://taskfile.dev/).
Provide recommendations for clarity, maintainability, and adherence to Taskfile best practices, including usage of variables, environment blocks, and includes.
These configurations may also contain embedded Bash scripts or commands.
Demonstrate bash scripting best practices such as error handling, secure variable expansions, and clear documentation.

  • lib/os-modules/Taskfile.yaml

cmds:
- |
# Convert newlines to spaces and remove backslashes
modules=$(echo "{{.MODULES}}" | tr '\n' ' ' | sed 's/\\//g')
for module in $modules
do
echo "Syncing files to ../$module..."
echo "Syncing files to ../$module ..."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Harden the sync script with strict error handling

Add set -euo pipefail at the top of the sync task’s inline script so that any error aborts the task immediately:

     cmds:
-      - |
+      - |
+        set -euo pipefail
         # Convert newlines to spaces and remove backslashes
         modules=$(echo "{{.MODULES}}" | tr '\n' ' ' | sed 's/\\//g')
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "Syncing files to ../$module ..."
cmds:
- |
set -euo pipefail
# Convert newlines to spaces and remove backslashes
modules=$(echo "{{.MODULES}}" | tr '\n' ' ' | sed 's/\\//g')
🤖 Prompt for AI Agents
In lib/os-modules/Taskfile.yaml at line 42, the sync task's inline script lacks
strict error handling. Add the line `set -euo pipefail` at the very beginning of
the script to ensure the task aborts immediately on any error, undefined
variable, or failed pipeline command.

@@ -5,8 +5,8 @@ vars:
terraform-aws-ssm-agent \
terraform-aws-tailscale \
terraform-datadog-users \
terraform-github-teams \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ordering modules in a-z order

@@ -32,12 +32,16 @@ tasks:
vars:
MODULES: "{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}{{.DEFAULT_MODULES}}{{end}}"
FILES: >-
.github
.trunk
.checkov.yaml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added and ordering a-z

Copy link
Member

@Gowiem Gowiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: -- Thanks Weston!

@westonplatter westonplatter merged commit 6142651 into main Jun 13, 2025
2 checks passed
@westonplatter westonplatter deleted the feat/add-linter-dotfiles branch June 13, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants