Repository navigation
feat: let plugins read models from the project under analysis - #141
Merged
Merged
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.
Closes #140. This is the engine hook
enterprise-validators(CoreTrace-Entreprise/coretrace-python-analyzer-plugins#25) needs, so a project can declare its validators in a file at its root.Change
Plugin.project_models(root) -> Sequence[Model]. It defaults to(), and returns models read from the project under analysis.plugin_models(plugins, root)registers them next to the plugin's own models, under the plugin's name, so a conflict still names both sides.--jobs, each worker calls it with the batch root, so every process sees the same models. A single-file check reads no project.ModelError. The command line now listsModelErroramong the errors it reports (exit status 2), so a bad declaration gives a message instead of a traceback. This also covers the existing case of two plugins declaring conflicting models.Verification
pytest: 1081 passed.ruff check src testsandmypyare clean.pytest -m regressionunder Python 3.12: 19 passed, no snapshot changed. No bundled plugin reads the project.ModelErrorthrough.