Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 2, 2025

  • Explore repository structure and understand test infrastructure
  • Understand how require: statement currently works
  • Understand analyzer vs suite structure
  • Modify test infrastructure to support importing analyzers
  • Update require: statement to accept analyzers (already handles it via runtime check)
  • Add function to handle both suites and analyzers in add-suite-under-test!
  • Verify functionality with test cases
  • Update existing analyzer tests to import analyzers directly
  • Run all tests to verify changes work (all 929 tests pass)
  • Add error handling to check-suite-analysis
  • Run security checks (no issues found)
  • Address review feedback: add #:analyzers parameter to refactoring-suite
  • Address review feedback: use reysntax-analyze-for-properties-only
Original prompt

This section details on the original issue you should resolve

<issue_title>Refactoring tests should be able to import specific analyzers</issue_title>
<issue_description>Currently, the require: test statement in #lang resyntax/test only supports importing entire refactoring suites. This makes testing analyzers awkward, as it's common to have an entire test file dedicated to a single analyzer, but analyzers aren't refactoring suites on their own. The require: statement should support importing analyzers directly, and imported analyzers should be added to the suite under test. The existing analyzer tests should be updated to import the tested analyzer directly instead of relying on the default import of the default-recommendations suite.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 2, 2025 01:58
Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
…-recommendations

Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor tests to support importing specific analyzers Support importing analyzers directly in test require: statements Nov 2, 2025
Copilot AI requested a review from jackfirth November 2, 2025 02:06
Copy link
Owner

@jackfirth jackfirth left a comment

Choose a reason for hiding this comment

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

Comment on lines 92 to 93
;; Additional analyzers that should be included when running analysis tests
(define current-analyzers-under-test (make-parameter (set)))
Copy link
Owner

Choose a reason for hiding this comment

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

This is unnecessary, just add analyzers to the suite directly. Add an #:analyzers argument to the refactoring-suite constructor that accepts a sequence of analyzers to include alongside the analyzers gathered from the suite's rules and subsuites.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit 1077e55. Added #:analyzers parameter to refactoring-suite constructor and updated add-suite-under-test! to add analyzers directly to the suite instead of tracking them separately.

…andling

Instead of tracking analyzers separately in test infrastructure, analyzers
are now added directly to the suite via the #:analyzers parameter. This
simplifies the implementation and makes the suite's analyzer collection
more explicit.

- Updated refactoring-suite contract to accept #:analyzers parameter
- Modified refactoring-suite function to combine rule analyzers with
  explicitly provided analyzers
- Updated add-suite-under-test! to build suites with analyzers included
- Simplified check-suite-analysis to use suite's analyzers directly
- Removed separate current-analyzers-under-test parameter

Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
Copilot AI requested a review from jackfirth November 2, 2025 03:10
@jackfirth jackfirth marked this pull request as ready for review November 2, 2025 03:53
@coveralls
Copy link

coveralls commented Nov 2, 2025

Pull Request Test Coverage Report for Build #127

Details

  • 28 of 32 (87.5%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 92.892%

Changes Missing Coverage Covered Lines Changed/Added Lines %
base.rkt 8 9 88.89%
test/private/rackunit.rkt 17 20 85.0%
Files with Coverage Reduction New Missed Lines %
main.rkt 1 54.05%
Totals Coverage Status
Change from base Build #123: -0.02%
Covered Lines: 14440
Relevant Lines: 15545

💛 - Coveralls

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Resyntax analyzed 5 files in this pull request and found no issues.

Copy link
Owner

@jackfirth jackfirth left a comment

Choose a reason for hiding this comment

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

Comment on lines 272 to 277
(λ ()
(define full-source (source->string program-src))
(if (string-prefix? full-source "#lang racket")
(source-code-analysis-added-syntax-properties
(source-analyze program-src #:analyzers all-analyzers))
(syntax-property-bundle)))))
Copy link
Owner

Choose a reason for hiding this comment

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

I think the right implementation here should just pass in the suite under test using (resyntax-analyze-for-properties-only program-src #:suite suite).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit 450875e. Simplified by delegating to reysntax-analyze-for-properties-only instead of reimplementing the analysis logic.

…s-only

Instead of reimplementing the analysis logic with error handling and
#lang racket checks, delegate to the existing reysntax-analyze-for-
properties-only function which already handles all these cases.

- Replaced custom analysis logic with call to reysntax-analyze-for-properties-only
- Removed unnecessary resyntax/private/analysis import
- Simplified implementation while maintaining same functionality

Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
Copilot AI requested a review from jackfirth November 2, 2025 04:11
@jackfirth jackfirth merged commit 85902ad into master Nov 2, 2025
8 checks passed
@jackfirth jackfirth deleted the copilot/refactor-test-imports branch November 2, 2025 04:28
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.

Refactoring tests should be able to import specific analyzers

3 participants