Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

The source-analyze function hardcoded three expansion analyzers. This change makes the analyzer list a required parameter to enable future work where analyzers are determined by the refactoring suite.

Changes:

  • Added #:analyzers required parameter to source-analyze
  • Updated contract to reflect the required parameter
  • Updated all callers in main.rkt to explicitly pass the analyzer list (identifier-usage-analyzer, ignored-result-values-analyzer, variable-mutability-analyzer)
  • Added required imports for analyzer modules in main.rkt
  • Refactored analyzer application from sequence-append of individual calls to transduce with append-mapping over the parameter
  • Added tests verifying empty, single, and default analyzer lists work correctly

Usage:

;; All callers must now explicitly pass analyzers
(source-analyze source
                #:lines lines
                #:analyzers (list identifier-usage-analyzer
                                  ignored-result-values-analyzer
                                  variable-mutability-analyzer))

;; Future: custom analyzer list from refactoring suite
(source-analyze source
                #:analyzers (refactoring-suite-analyzers suite))

All existing callers have been updated to explicitly pass the analyzer list.

Original prompt

This section details on the original issue you should resolve

<issue_title>Analyzers should be passed into source-analyze</issue_title>
<issue_description>The source-analyze function currently uses a hardcoded list of expansion analyzers. That list should be an argument to the function, instead. For now, callers can just pass in the same hardcoded list; future work will make the list of analyzers part of the refactoring suite being used.</issue_description>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits October 31, 2025 17:18
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 source-analyze to accept analyzers as argument Pass analyzers as parameter to source-analyze instead of hardcoding Oct 31, 2025
Copilot AI requested a review from jackfirth October 31, 2025 17:21
@jackfirth jackfirth marked this pull request as ready for review October 31, 2025 18:33
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 9 to 12
[source-analyze (->* (source?)
(#:lines range-set?
#:analyzers (listof expansion-analyzer?))
source-code-analysis?)]
Copy link
Owner

Choose a reason for hiding this comment

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

Make it a required parameter and update the callers to pass in the list instead.

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 feb8469. The #:analyzers parameter is now required, and all callers in main.rkt explicitly pass the list of analyzers.

Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
Copilot AI changed the title Pass analyzers as parameter to source-analyze instead of hardcoding Pass analyzers as required parameter to source-analyze Oct 31, 2025
Copilot AI requested a review from jackfirth October 31, 2025 18:45
@jackfirth jackfirth enabled auto-merge (squash) October 31, 2025 19:28
@jackfirth jackfirth merged commit 697eade into master Oct 31, 2025
6 checks passed
@jackfirth jackfirth deleted the copilot/refactor-source-analyze-analyzers branch October 31, 2025 19:37
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.

Analyzers should be passed into source-analyze

2 participants