Skip to content

feat: add js/ts family support#3

Closed
yanxi123-com wants to merge 9 commits intocodex/pythonfrom
codex/js
Closed

feat: add js/ts family support#3
yanxi123-com wants to merge 9 commits intocodex/pythonfrom
codex/js

Conversation

@yanxi123-com
Copy link
Copy Markdown
Owner

Summary

  • add js,ts,jsx,tsx,cjs,mjs language detection and make the default language scope include all supported languages
  • classify JS/TS unit and e2e test files for --test and --no-test using path and filename conventions
  • fix cross-language rename handling so test filtering classifies old and new sides with the correct language backend

Testing

  • cargo fmt --all
  • cargo test -v
  • cargo clippy --all-targets --all-features -- -D warnings

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c094a5c32

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lang/mod.rs
Comment on lines 17 to +21
.filter(|change| {
detect_language(&change.path)
.map(|language| requested.contains(&language))
.unwrap_or(false)
detect_language(&change.old_path)
.into_iter()
.chain(detect_language(&change.new_path))
.any(|language| requested.contains(&language))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Split cross-language renames before applying --no-test-filter

This broader filter now keeps any rename where either old_path or new_path matches the requested language, but the TestFilterMode::All branch in src/main.rs still renders change.added/change.deleted verbatim. In a rename like tests/test_mod.py => src/lib.rs, git diff-stat --lang py --no-test-filter will incorrectly include the Rust additions, and --lang rs --no-test-filter will incorrectly include the Python deletions, so language-scoped stats become wrong whenever a file crosses language boundaries.

Useful? React with 👍 / 👎.

@yanxi123-com
Copy link
Copy Markdown
Owner Author

Closing in favor of #2. This stacked PR is now redundant because #2 is the single branch/PR we are keeping for the combined Python + JS/TS work and the latest review fixes.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f525a4860f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main.rs
Comment on lines +29 to +30
let stats =
build_test_filtered_stats(&git, &selection, &changes, &langs, cli.test_filter_mode())?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the raw-numstat path for --no-test-filter

Routing TestFilterMode::All through build_test_filtered_stats means git diff-stat --no-test-filter now reads/parses selected Rust and Python sources again instead of just rendering git diff --numstat. That regresses the documented “disable test filtering” behavior: for example, a repo with any tracked .rs file that is not valid UTF-8 will now fail under --no-test-filter because build_whole_test_paths eagerly loads Rust sources, even if that file is unchanged. The old direct-render fast path should stay in place for All so this mode remains a safe fallback.

Useful? React with 👍 / 👎.

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.

1 participant