Repository navigation
Feat/python analysis - #45
Merged
Merged
Conversation
The config carrying macros, include paths and filters was written to the extension's install folder. When that failed, generateConfigFileIfNeeded returned false, which the caller read as "no config needed": ctrace ran without the requested settings. - Write the report and config files to the extension's storage, or to a private temporary folder when it is not writable. - Throw when the config cannot be written, naming the settings that would be lost; false now only means that no config is needed. - Stop before launching ctrace and show the message in a notification, the output channel and the sidebar. - Add a "workspace" test configuration that runs Run Analysis with a folder open, and check that nothing is launched when the files cannot be written. Fixes #44
Moving the scan files to a temporary folder exposed it on Windows CI: C:\Users\RUNNER~1\... was rejected as unsafe, so no analysis could start. The same happened for any path with a space, parentheses or an accent, like "C:\Users\Jean Dupont" or "Program Files (x86)". The validator now checks the option name strictly and only rejects shell syntax in values, since every token is single-quoted again before use. Entry points stay limited to function names.
ctrace 0.85 ships a Python analyzer: it runs on .py inputs under --static or --invoke=coretrace-python-analyzer and reports in SARIF, like the C tools. The extension only accepted C/C++ files, so it could not be used. - Accept .py files for Run Analysis, and scan them in a workspace, skipping virtual environments and caches (.venv, site-packages...). - Add coretrace-python-analyzer to the Static tools menu. A saved sidebar state from before it existed turns it on, like a fresh install. - Choose the tools per file language. A C run never names the Python analyzer, which ctrace before 0.85 rejects with "Unknown tool", and a Python run gets no dynamic analysis and no stack pass. - Check the C analyzer installation only when C/C++ files are analysed. - Keep one incremental cache key per language: Python results depend on requirement manifests instead of C headers. - Offer the ignore quick fix on Python diagnostics. Tests cover the tool choice per language, and Run Analysis in a workspace holding C, Python and a .venv. With CTRACE_BIN set to ctrace 0.85, a Python finding is checked in the Problems panel.
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.
No description provided.