Add Analyze Changed Files action for Git-tracked projects - #120
Open
Bazooper-blip wants to merge 1 commit into
Open
Add Analyze Changed Files action for Git-tracked projects#120Bazooper-blip wants to merge 1 commit into
Bazooper-blip wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #3: a new Analyze Changed Files action that analyzes every Delphi source file the project's Git repository reports as changed (modified, staged, or untracked), mirroring SonarLint's "Analyze VCS Changed Files".
Changes:
DelphiLint.VersionControlunit.TryGetChangedDelphiFilesrunsgit rev-parse --show-cdupandgit status --porcelain --no-renames(headless, output captured over a pipe, 10s timeout) in the analysis base directory, and returns absolute paths of changed Delphi sources that still exist. The porcelain parsing is a separate pure function covered by unit tests (deleted files excluded, malformed lines skipped, quoted paths unescaped).--show-cduprather than--show-toplevel, because the latter canonicalizes mapped/substituted drives to physical paths that don't match the IDE's file paths — which would make the analyzer's base-directory filter silently drop every file. (Found this the hard way on a subst'd drive.)ActionAnalyzeChangedFilesin the plugin, wired into the DelphiLint main menu, the tool window's popup menu, IDE Insight, and toolbar customization/cleanup, with the same enablement rules as the other analyze actions. "Save before analysis" saves only open editors whose files are in the changed set.Design choices to sanity-check in review:
gitexecutable, rather than the ToolsAPI version-control services — simpler, and matches what most git-based tooling does; other VCSes could be added behind the same function later.Testing: new
DelphiLintTest.VersionControlDUnitX fixture for the porcelain parsing (4 tests, all passing; full suite passes at the same rate as master). The git integration itself was exercised end-to-end with a console harness against a real repository — from the repo root, from subdirectories, on a substituted drive, and against a non-repository directory. I have not yet exercised the action inside the IDE itself.