-
Notifications
You must be signed in to change notification settings - Fork 12
Support importing analyzers directly in test require: statements #703
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
Conversation
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>
jackfirth
left a comment
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.
test/private/rackunit.rkt
Outdated
| ;; Additional analyzers that should be included when running analysis tests | ||
| (define current-analyzers-under-test (make-parameter (set))) |
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.
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.
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.
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>
Pull Request Test Coverage Report for Build #127Details
💛 - Coveralls |
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.
Resyntax analyzed 5 files in this pull request and found no issues.
jackfirth
left a comment
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.
test/private/rackunit.rkt
Outdated
| (λ () | ||
| (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))))) |
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.
I think the right implementation here should just pass in the suite under test using (resyntax-analyze-for-properties-only program-src #:suite suite).
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.
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>
require:statement currently worksrequire:statement to accept analyzers (already handles it via runtime check)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.