Commit 69dd3fe
feat(pypi): add pyproject.toml support to IntelliJ plugin (#244)
* feat(pypi): add pyproject.toml support to IntelliJ plugin
Add component analysis support for pyproject.toml manifest files,
enabling inline vulnerability diagnostics for Python projects using
PEP 621 ([project.dependencies]) and Poetry
([tool.poetry.dependencies]) formats.
New classes:
- PyprojectCAAnnotator: extracts dependencies from TOML PSI structure
- PyprojectCAIntentionAction: quick-fix for version updates
- PyprojectCAInspection: inspection registration
Modified files:
- SaAction, SaUtils: recognize pyproject.toml as supported manifest
- CAAnnotator, SAIntentionAction: add pyproject.toml to python mapping
- ApiService: apply Python-specific settings for pyproject.toml
- plugin.xml: register annotator and inspection for TOML language
- README.md: document pyproject.toml support
Implements TC-3853
Assisted-by: Claude Code
* fix(pypi): address Qodo review findings for pyproject.toml support
- Fix PEP 621 annotation targeting: use individual TomlLiteral elements
instead of parent TomlKeyValue so each dependency gets its own highlight
- Fix quick-fix replacement: preserve package name in PEP 508 strings
(e.g. "anyio==3.6.2" → "anyio==4.0.0" instead of just "==4.0.0")
- Add [project.optional-dependencies] parsing for PEP 621 optional groups
- Update README to reflect optional-dependencies are now analyzed
Implements TC-3853
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Assisted-by: Claude Code
* fix(pypi): preserve PEP 508 extras and markers in quick fix and version extraction
The version extraction regex was matching across the ';' environment
marker boundary, and the quick fix was dropping extras and markers
when rewriting the dependency string.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: fail fast when the toml file is not Cargo.toml
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
* fix: implement license abstract methods
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
* test(pypi): add unit tests for pyproject.toml support
Add 35 tests covering PEP 508 utility methods, PEP 621 and Poetry
dependency extraction, optional dependencies, intention action version
updates, availability checks, and SaAction/SaUtils manifest recognition.
Implements TC-4172
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Assisted-by: Claude Code
* fix(pypi): resolve Poetry ignore comment misbind for multi-line inline tables
When a trustify-da-ignore comment was placed on an inner key of a
multi-line Poetry inline table, findAssociatedDependency() returned
the inner key name (e.g., "version") instead of the outer dependency
name. Added resolvePoetryDependencyEntry() to walk up from inner
TomlKeyValue through TomlInlineTable to the actual dependency entry.
Resolves: TC-4173
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9e75dcc commit 69dd3fe
13 files changed
Lines changed: 1343 additions & 10 deletions
File tree
- src
- main
- java/org/jboss/tools/intellij
- componentanalysis
- cargo
- pypi
- exhort
- stackanalysis
- resources/META-INF
- test/java/org/jboss/tools/intellij/componentanalysis/pypi
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
321 | 336 | | |
322 | 337 | | |
323 | 338 | | |
| |||
365 | 380 | | |
366 | 381 | | |
367 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
368 | 387 | | |
369 | 388 | | |
370 | 389 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
381 | 385 | | |
382 | 386 | | |
383 | 387 | | |
384 | | - | |
| 388 | + | |
0 commit comments