Skip to content

Fix ruff devcontainer config#81

Merged
ejfine merged 5 commits intomainfrom
fix-ruff
Aug 19, 2025
Merged

Fix ruff devcontainer config#81
ejfine merged 5 commits intomainfrom
fix-ruff

Conversation

@ejfine
Copy link
Contributor

@ejfine ejfine commented Aug 19, 2025

Why is this change necessary?

Copilot lied about using workspaceFolder, it doesn't work

How does this change address the issue?

reverts to explicit path

What side effects does this change have?

Things work again

How is this change tested?

They worked before

Other

Bumped some dependencies
Ignoring snapshots for more pre-commit hooks

Summary by CodeRabbit

  • New Features

    • None.
  • Bug Fixes

    • Excluded test snapshot files from formatting hooks to reduce noisy diffs.
  • Chores

    • Updated devcontainer tooling and VS Code extension versions.
    • Adjusted devcontainer Ruff config path handling for templates.
    • Bumped tool versions (Copier, pre-commit, Pulumi) and refreshed pre-commit hook revisions.

@ejfine ejfine requested a review from Copilot August 19, 2025 13:38
@ejfine ejfine self-assigned this Aug 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 19, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Bumped multiple tooling and extension versions, switched Ruff VS Code configuration to an absolute workspace path in devcontainer files, updated pre-commit hook revisions and added excludes for test snapshot directories. No runtime logic changes.

Changes

Cohort / File(s) Summary of Changes
Devcontainer Ruff config
.devcontainer/devcontainer.json, template/.devcontainer/devcontainer.json.jinja-base
Bump Ruff VS Code extension 2025.22.0 → 2025.24.0; change ruff.configuration from workspace-relative to absolute /workspaces/.../ruff-test.toml; update devcontainer context hash comment.
CI tooling versions
.devcontainer/install-ci-tooling.py, extensions/context.py
Update constants: COPIER_VERSION 9.8.0 → 9.9.1; PRE_COMMIT_VERSION 4.2.0 → 4.3.0; bump pulumi_version 3.189.0 → 3.190.0 in context. No logic/flow changes.
Pre-commit hook config
.pre-commit-config.yaml
Bump minimum_pre_commit_version and multiple hook revisions (typos, pre-commit-hooks, ruff-pre-commit, pylint, etc.); add excludes for tests/**/__snapshots__/** to trailing-whitespace, end-of-file-fixer, pretty-format-json and related patterns.

Sequence Diagram(s)

(omitted — changes are configuration/version updates without new control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Nuxt 4 #79 — Modifies devcontainer Ruff configuration and template devcontainer entries similar to this PR.
  • Readme update #72 — Related updates to devcontainer metadata and tooling version constants (copier / pre-commit).
  • Bump context #73 — Bumps dependency/version constants in extensions/context.py, overlapping area of change.

Poem

A rabbit hops through version fields, so spry,
Nudging Ruff, copier, hooks to fly.
Snapshots tucked behind an excluded door,
Tooling numbers climbed — the repo’s core.
A tidy burrow, ready — hop, hop, hooray! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-ruff

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a configuration issue with the ruff VS Code extension in devcontainer environments where ${workspaceFolder} was not working correctly, reverting to explicit paths. Additionally, several project dependencies have been updated to their latest versions.

  • Fixed ruff configuration path in devcontainer by replacing ${workspaceFolder} with explicit /workspaces/{repo_name} paths
  • Updated multiple dependencies including pre-commit (4.2.0 → 4.3.0), copier (9.8.0 → 9.9.1), and pulumi (3.189.0 → 3.190.0)
  • Added snapshot directories to pre-commit hook exclusions

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
template/.devcontainer/devcontainer.json.jinja-base Fixed ruff configuration path and updated ruff extension version
extensions/context.py Updated dependency versions for pre-commit, copier, and pulumi
.pre-commit-config.yaml Updated pre-commit hook versions and added snapshot exclusions
.devcontainer/install-ci-tooling.py Updated copier and pre-commit version constants
.devcontainer/devcontainer.json Applied same ruff configuration fix and updated hash

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

# Reformatting (should generally come before any file format or other checks, because reformatting can change things)
- repo: https://github.com/crate-ci/typos
rev: 392b78fe18a52790c53f42456e46124f77346842 # frozen: v1.34.0
rev: 7fb6e0951ad91e4772a2470012fc1ae621016b80 # frozen: v1
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The frozen comment shows 'v1' which is inconsistent with other entries that show specific version numbers like 'v1.34.0'. This makes it unclear which exact version is being used.

Suggested change
rev: 7fb6e0951ad91e4772a2470012fc1ae621016b80 # frozen: v1
rev: 7fb6e0951ad91e4772a2470012fc1ae621016b80 # frozen: v1.14.0

Copilot uses AI. Check for mistakes.
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: 0

🧹 Nitpick comments (4)
extensions/context.py (1)

11-19: Reduce duplication of version literals across files

You already note duplication with install-ci-tooling.py. Consider centralizing these version pins (e.g., a single versions.yml/toml consumed by both this hook and the installer), or adding a simple check in CI to enforce parity.

If helpful, I can draft a minimal versions.toml loader and a CI check to validate alignment across files.

Also applies to: 20-29

.devcontainer/install-ci-tooling.py (1)

8-12: Avoid hardcoding version pins in multiple places

Optional: load these from a single source (env file, versions.toml, or even reusing extensions/context.py via import) to prevent drift.

Example approach (env fallback):

COPIER_VERSION = os.getenv("COPIER_VERSION", "9.9.1")
PRE_COMMIT_VERSION = os.getenv("PRE_COMMIT_VERSION", "4.3.0")

I can also sketch a tiny versions.toml and loader if you want it standardized across Python and Jinja templates.

template/.devcontainer/devcontainer.json.jinja-base (1)

65-65: Absolute ruff.configuration requires an absolute path – document the rationale

VS Code’s ${workspaceFolder} isn’t expanded by the Ruff extension for ruff.configuration (only environment variables and ~ are supported), so an absolute path is necessary. Add an inline note to explain this and prevent accidental reversion:

-        "ruff.configuration": "/workspaces/{{ repo_name }}/ruff-test.toml", // use the test configuration since it's less restrictive and won't show false positives and underline things
+        // NOTE: ${workspaceFolder} isn’t expanded here; `ruff.configuration` only supports env vars/`~`, so we use an absolute path.
+        "ruff.configuration": "/workspaces/{{ repo_name }}/ruff-test.toml", // use the test configuration since it's less restrictive and won't show false positives and underline things

Optionally, for portability you could leverage environment‐variable expansion (e.g. "$WORKSPACE_ROOT/ruff-test.toml").

Also confirm that repo_name always matches the folder name inside the container for all template consumers.

.pre-commit-config.yaml (1)

1-4: Minor consistency check: minimum_pre_commit_version vs installer

minimum_pre_commit_version is 4.0.1 while the installer pins pre-commit to 4.3.0. This is fine, but keep in mind the floor doesn’t enforce the exact version. If you intend to guarantee 4.3.0 features, consider aligning the minimum accordingly.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 48755b0 and 9fe773f.

📒 Files selected for processing (5)
  • .devcontainer/devcontainer.json (3 hunks)
  • .devcontainer/install-ci-tooling.py (1 hunks)
  • .pre-commit-config.yaml (8 hunks)
  • extensions/context.py (2 hunks)
  • template/.devcontainer/devcontainer.json.jinja-base (2 hunks)
🔇 Additional comments (13)
extensions/context.py (3)

15-17: Version bumps aligned; good update

pre_commit_version -> 4.3.0 and copier_version -> 9.9.1 look consistent with the rest of the PR.


28-28: Pulumi minor upgrade looks fine

3.190.0 is a routine bump with no code flow changes here.


15-17: Cross-file versions are aligned

Verified that pre_commit_version (4.3.0) and copier_version (9.9.1) in extensions/context.py exactly match PRE_COMMIT_VERSION and COPIER_VERSION in .devcontainer/install-ci-tooling.py. No further updates required.

.devcontainer/install-ci-tooling.py (1)

9-11: Tooling versions bumped appropriately

COPIER_VERSION -> 9.9.1 and PRE_COMMIT_VERSION -> 4.3.0 align with extensions/context.py updates.

template/.devcontainer/devcontainer.json.jinja-base (1)

38-38: Ruff VS Code extension version bump is fine

2025.24.0 looks consistent with the root devcontainer.

.devcontainer/devcontainer.json (3)

32-32: Ruff extension bump aligns with the template

Upgrading to 2025.24.0 is consistent and low risk.


62-62: Context hash updated

Pre-commit managed hash looks updated. No action needed.


51-51: Absolute ruff.configuration path verified

The ruff-test.toml file is present at the repository root, so the hard-coded path in .devcontainer/devcontainer.json will resolve correctly in the container.

No changes needed.

.pre-commit-config.yaml (5)

45-45: typos hook pinned and updated

Moving to a newer commit (frozen) is fine; keeping it pinned is good practice.


56-56: pre-commit-hooks bumped to v6.0.0 across sections

Consistent upgrades across sections; looks good.

Also applies to: 157-158, 207-208


63-64: Excluding test snapshots from formatters is sensible

Avoids churn and noise from generated snapshots.

Also applies to: 76-77, 91-92


229-229: Ruff pre-commit hook updated to v0.12.9

Matches the general tooling refresh; no concerns.


242-242: Pylint bumped to v3.3.8

Straightforward version bump; should be fine.

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: 0

♻️ Duplicate comments (1)
.pre-commit-config.yaml (1)

45-45: Clarify frozen version for typos: replace ambiguous "v1" with the exact tag.

This mirrors an existing review: “frozen: v1” is ambiguous compared to explicit tags elsewhere. Pin the comment to the precise version for clarity.

-    rev: 7fb6e0951ad91e4772a2470012fc1ae621016b80  # frozen: v1
+    rev: 7fb6e0951ad91e4772a2470012fc1ae621016b80  # frozen: v1.14.0
🧹 Nitpick comments (4)
.pre-commit-config.yaml (4)

1-1: Align minimum_pre_commit_version with the rest of the repo (4.3.0).

Other files in this PR bump pre-commit to 4.3.0; consider aligning the minimum here for consistency and to avoid confusion.

-minimum_pre_commit_version: 4.2.0
+minimum_pre_commit_version: 4.3.0

58-65: Snapshot exclude pattern may miss top-level tests/snapshots.

The pattern .*tests/.*/__snapshots__/.* requires at least one directory between tests/ and __snapshots__. It won’t match tests/__snapshots__/.... Use a simpler and more robust pattern to catch snapshots anywhere.

-              .*tests/.*/__snapshots__/.*|
+              .*__snapshots__/.*|

66-81: Extend end-of-file-fixer exclude: same snapshot pattern issue.

Apply the same robust pattern so top-level snapshot dirs are excluded here as well.

-              .*tests/.*/__snapshots__/.*|
+              .*__snapshots__/.*|

82-93: Extend pretty-format-json exclude: same snapshot pattern issue.

Unify on the simpler .*__snapshots__/.* so all snapshot directories are consistently excluded.

-              .*tests/.*/__snapshots__/.*|
+              .*__snapshots__/.*|
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9fe773f and 2a33a92.

📒 Files selected for processing (2)
  • .devcontainer/devcontainer.json (3 hunks)
  • .pre-commit-config.yaml (9 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .devcontainer/devcontainer.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.12.7, --data-file tests/copier_data/data1.yaml)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.13.1, --data-file tests/copier_data/data1.yaml)
🔇 Additional comments (3)
.pre-commit-config.yaml (3)

56-56: LGTM on pre-commit-hooks bumps to v6.0.0.

Pinned to commit SHAs with clear frozen tags; no concerns.

Also applies to: 157-157, 207-207


242-249: pylintrc.toml presence confirmed
The pylintrc.toml file was found at the repository root, so the hook’s --rcfile reference is valid.


229-239: Ruff configs exist and pre-commit entries are correct.

Both ruff.toml and ruff-test.toml are present at the repo root, and the .pre-commit-config.yaml hooks correctly reference --config=./ruff.toml (lines 233–234) and --config=./ruff-test.toml (lines 237–238). No further changes needed.

@ejfine ejfine merged commit 12c57a4 into main Aug 19, 2025
7 checks passed
@ejfine ejfine deleted the fix-ruff branch August 19, 2025 14:16
@coderabbitai coderabbitai bot mentioned this pull request Sep 4, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 15, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 27, 2025
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