Skip to content

feat: add Dart Frog detector and analyzer (dart web framework)#1337

Merged
hahwul merged 1 commit intomainfrom
feat/add-dart_frog-detector-analyzer
May 2, 2026
Merged

feat: add Dart Frog detector and analyzer (dart web framework)#1337
hahwul merged 1 commit intomainfrom
feat/add-dart_frog-detector-analyzer

Conversation

@hahwul
Copy link
Copy Markdown
Member

@hahwul hahwul commented May 2, 2026

Closes #1214

@github-actions github-actions Bot added 🔎 detector Issue for Detector 🔬 analyzer Issue for Analyzer 💊 spec Issue for test codes labels May 2, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the Dart Frog framework by implementing a new detector and analyzer along with functional and unit tests. The analyzer handles filesystem-based routing, translates dynamic segments like [id] to {id}, and detects HTTP methods from source code. A review comment suggests using rindex instead of index to find the /routes/ directory to prevent potential path resolution issues in nested directory structures.

parallel_analyze(channel) do |path|
next unless path.ends_with?(".dart")

idx = path.index("/routes/")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using index to find the /routes/ directory can be problematic if a parent directory in the path also contains the string /routes/ (e.g., in certain monorepo structures or specific deployment paths). Using rindex ensures that we identify the routes directory closest to the file, which is the correct behavior for filesystem-based routing in Dart Frog.

          idx = path.rindex("/routes/")

@hahwul hahwul merged commit d981a11 into main May 2, 2026
10 checks passed
@hahwul hahwul deleted the feat/add-dart_frog-detector-analyzer branch May 2, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔬 analyzer Issue for Analyzer 🔎 detector Issue for Detector 💊 spec Issue for test codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Dart Frog detector & analyzer (dart web framework)

1 participant