scip-cli 2.2.1__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scip_cli-2.3.0/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
- scip_cli-2.3.0/.github/ISSUE_TEMPLATE/feature_request.md +33 -0
- scip_cli-2.3.0/.github/ISSUE_TEMPLATE/question.md +21 -0
- scip_cli-2.3.0/.github/pull_request_template.md +43 -0
- scip_cli-2.3.0/CODE_OF_CONDUCT.md +128 -0
- scip_cli-2.3.0/CONTRIBUTING.md +95 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/PKG-INFO +21 -3
- {scip_cli-2.2.1 → scip_cli-2.3.0}/README.md +20 -2
- scip_cli-2.3.0/SECURITY.md +46 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/SKILL.md +17 -1
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/__init__.py +1 -1
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/__main__.py +9 -1
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/cli_args.py +1 -1
- scip_cli-2.3.0/scip_cli/commands/deps.py +144 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scripts/publish.sh +4 -4
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/e2e_harness.py +1 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_e2e.py +19 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_e2e_perf.py +1 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/.cursor/rules/agent.mdc +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/.gitignore +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/.pre-commit-config.yaml +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/LICENSE +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/pyproject.toml +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/__init__.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/common.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/file.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/graph.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/live.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/project.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/sections.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/symbol.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/analyze/targets.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/cache.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/__init__.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/analyze.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/code.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/members.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/rdeps.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/refs.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/reindex.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/search.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/skill.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/commands/symbols.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/config.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/debug.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/discover.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/indexing.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/merge.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/output.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/paths.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/project.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/queries.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/scip_tool.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/scope.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/session.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/source.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/sql.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/symbols.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scip_cli/targets.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scripts/build.sh +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/scripts/test.sh +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/__init__.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/analyze_db.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/conftest.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixture_catalog.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/package.json +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/app/handler.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/config.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/consumer.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/dead.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/domain/i18n/en.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/domain/i18n/index.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/domain/i18n/useLocale.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/domain/labels/index.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/events/streamTypes.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/gateway/index.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/helper.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/hooks/useHookA.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/hooks/useHookB.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/hooks/useItems.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/index.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/integrations/inferenceClient.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/loaders/useInference.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/pages/panelPage.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/rules/applyRule.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/types/a.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/types/b.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/ui/Button.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/ui/LazyPanel.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/ui/buttonConsumer.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/ui/menuModule.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/user.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/widget.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/widgets/OrphanWidget.ts +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/tsconfig.json +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/perf_util.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_analyze.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_analyze_graph.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_analyze_perf.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_cache.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_composability.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_config.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_discover.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_e2e_analyze_patterns.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_index_prune.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_indexer_env.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_merge.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_multi_symbol.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_pure_functions.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_qualified_symbols.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_reindex.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_scip_tool.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_scope.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_targets.py +0 -0
- {scip_cli-2.2.1 → scip_cli-2.3.0}/tests/test_typescript_projects.py +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Report a bug or unexpected behavior
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Describe the bug**
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
**To Reproduce**
|
|
13
|
+
Steps to reproduce the behavior:
|
|
14
|
+
1. Run command: `scip-cli ...`
|
|
15
|
+
2. On project: [describe project type, size, language]
|
|
16
|
+
3. See error
|
|
17
|
+
|
|
18
|
+
**Expected behavior**
|
|
19
|
+
A clear and concise description of what you expected to happen.
|
|
20
|
+
|
|
21
|
+
**Actual behavior**
|
|
22
|
+
What actually happened. Include error messages, stack traces, or unexpected output.
|
|
23
|
+
|
|
24
|
+
**Environment**
|
|
25
|
+
- OS: [e.g., Ubuntu 22.04, macOS 14.0]
|
|
26
|
+
- Python version: [e.g., 3.11.5]
|
|
27
|
+
- scip-cli version: [e.g., 0.5.0]
|
|
28
|
+
- Node.js version: [e.g., 20.10.0] (if applicable)
|
|
29
|
+
|
|
30
|
+
**Additional context**
|
|
31
|
+
Add any other context about the problem here (logs, screenshots, project structure).
|
|
32
|
+
|
|
33
|
+
**Checklist**
|
|
34
|
+
- [ ] I've searched existing issues for similar bugs
|
|
35
|
+
- [ ] I've included a minimal reproducible example (if possible)
|
|
36
|
+
- [ ] I've provided my environment details
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest an idea or enhancement
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Is your feature request related to a problem? Please describe.**
|
|
10
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
11
|
+
|
|
12
|
+
**Describe the solution you'd like**
|
|
13
|
+
A clear and concise description of what you want to happen.
|
|
14
|
+
|
|
15
|
+
**Describe alternatives you've considered**
|
|
16
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
17
|
+
|
|
18
|
+
**Use case**
|
|
19
|
+
Describe your use case and how this feature would help you.
|
|
20
|
+
|
|
21
|
+
**Example usage**
|
|
22
|
+
If applicable, show how you'd use this feature:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
scip-cli <command> [arguments]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Additional context**
|
|
29
|
+
Add any other context, mockups, or examples about the feature request here.
|
|
30
|
+
|
|
31
|
+
**Checklist**
|
|
32
|
+
- [ ] I've searched existing issues for similar feature requests
|
|
33
|
+
- [ ] I've explained my use case clearly
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Question
|
|
3
|
+
about: Ask a question about usage or behavior
|
|
4
|
+
title: '[QUESTION] '
|
|
5
|
+
labels: question
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Your question**
|
|
10
|
+
A clear and concise question about scip-cli usage, behavior, or configuration.
|
|
11
|
+
|
|
12
|
+
**Context**
|
|
13
|
+
What are you trying to accomplish? What have you tried so far?
|
|
14
|
+
|
|
15
|
+
**Environment** (if relevant)
|
|
16
|
+
- OS: [e.g., Ubuntu 22.04]
|
|
17
|
+
- Python version: [e.g., 3.11.5]
|
|
18
|
+
- scip-cli version: [e.g., 0.5.0]
|
|
19
|
+
|
|
20
|
+
**Additional context**
|
|
21
|
+
Any other context, code examples, or screenshots that might help answer your question.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Brief description of what this PR does and why.
|
|
4
|
+
|
|
5
|
+
Fixes #(issue)
|
|
6
|
+
|
|
7
|
+
## Type of Change
|
|
8
|
+
|
|
9
|
+
- [ ] Bug fix (non-breaking change that fixes an issue)
|
|
10
|
+
- [ ] New feature (non-breaking change that adds functionality)
|
|
11
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
|
12
|
+
- [ ] Documentation update
|
|
13
|
+
- [ ] Performance improvement
|
|
14
|
+
- [ ] Refactoring (no functional changes)
|
|
15
|
+
|
|
16
|
+
## Changes Made
|
|
17
|
+
|
|
18
|
+
-
|
|
19
|
+
-
|
|
20
|
+
-
|
|
21
|
+
|
|
22
|
+
## Testing
|
|
23
|
+
|
|
24
|
+
- [ ] `pytest` passes
|
|
25
|
+
- [ ] `ruff check .` passes
|
|
26
|
+
- [ ] `ruff format .` passes
|
|
27
|
+
- [ ] E2E tests pass (if CLI behavior changed): `pytest tests/test_e2e.py`
|
|
28
|
+
|
|
29
|
+
## Checklist
|
|
30
|
+
|
|
31
|
+
- [ ] My code follows the project's style guidelines
|
|
32
|
+
- [ ] I have self-reviewed my code
|
|
33
|
+
- [ ] I have updated documentation (README, SKILL.md) if needed
|
|
34
|
+
- [ ] I have added tests for new functionality
|
|
35
|
+
- [ ] All new and existing tests pass
|
|
36
|
+
|
|
37
|
+
## Screenshots / Output
|
|
38
|
+
|
|
39
|
+
If applicable, paste relevant CLI output or screenshots here.
|
|
40
|
+
|
|
41
|
+
## Additional Notes
|
|
42
|
+
|
|
43
|
+
Anything else reviewers should know.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
ariel.flesler@gmail.com.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Contributing to scip-cli
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to scip-cli! This document provides guidelines and information for contributors.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
|
8
|
+
|
|
9
|
+
## How to Contribute
|
|
10
|
+
|
|
11
|
+
### Reporting Bugs
|
|
12
|
+
|
|
13
|
+
Before creating bug reports, please check existing issues. When creating a bug report, include:
|
|
14
|
+
|
|
15
|
+
- Clear, descriptive title
|
|
16
|
+
- Steps to reproduce the issue
|
|
17
|
+
- Expected vs actual behavior
|
|
18
|
+
- Environment details (OS, Python version, scip-cli version)
|
|
19
|
+
- Minimal reproducible example if possible
|
|
20
|
+
|
|
21
|
+
### Suggesting Enhancements
|
|
22
|
+
|
|
23
|
+
Enhancement suggestions are welcome! Please:
|
|
24
|
+
|
|
25
|
+
- Use a clear, descriptive title
|
|
26
|
+
- Provide a detailed description of the proposed enhancement
|
|
27
|
+
- Explain why this enhancement would be useful
|
|
28
|
+
- Include examples of how it would be used
|
|
29
|
+
|
|
30
|
+
### Pull Requests
|
|
31
|
+
|
|
32
|
+
1. Fork the repository
|
|
33
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
34
|
+
3. Make your changes
|
|
35
|
+
4. Run tests: `pytest`
|
|
36
|
+
5. Run linter: `ruff check .` and `ruff format .`
|
|
37
|
+
6. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
38
|
+
7. Push to the branch (`git push origin feature/amazing-feature`)
|
|
39
|
+
8. Open a Pull Request
|
|
40
|
+
|
|
41
|
+
## Development Setup
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Clone your fork
|
|
45
|
+
git clone https://github.com/your-username/scip-cli.git
|
|
46
|
+
cd scip-cli
|
|
47
|
+
|
|
48
|
+
# Install with dev dependencies
|
|
49
|
+
pip install -e ".[dev]"
|
|
50
|
+
|
|
51
|
+
# Install pre-commit hooks
|
|
52
|
+
pre-commit install
|
|
53
|
+
|
|
54
|
+
# Run tests
|
|
55
|
+
pytest
|
|
56
|
+
|
|
57
|
+
# Run linter
|
|
58
|
+
ruff check .
|
|
59
|
+
ruff format .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Testing
|
|
63
|
+
|
|
64
|
+
- Run full test suite: `pytest`
|
|
65
|
+
- Run E2E tests: `pytest tests/test_e2e.py tests/test_e2e_analyze_patterns.py`
|
|
66
|
+
- Integration tests require Node.js and `npx` (for `scip-typescript`)
|
|
67
|
+
|
|
68
|
+
## Code Style
|
|
69
|
+
|
|
70
|
+
- Python 3.9+
|
|
71
|
+
- Line length: 120 characters
|
|
72
|
+
- Use type hints where practical
|
|
73
|
+
- Follow existing code patterns
|
|
74
|
+
- No unnecessary comments
|
|
75
|
+
- Use double quotes for strings
|
|
76
|
+
|
|
77
|
+
## Commit Messages
|
|
78
|
+
|
|
79
|
+
- Use clear, descriptive commit messages
|
|
80
|
+
- Start with a verb in imperative mood: "Add", "Fix", "Update", "Remove"
|
|
81
|
+
- Keep the first line under 72 characters
|
|
82
|
+
- Reference issues when applicable
|
|
83
|
+
|
|
84
|
+
## Documentation
|
|
85
|
+
|
|
86
|
+
- Update README.md for user-facing changes
|
|
87
|
+
- Update SKILL.md if CLI flags or commands change
|
|
88
|
+
- Add docstrings to new functions
|
|
89
|
+
- Keep comments minimal but meaningful
|
|
90
|
+
|
|
91
|
+
## Questions?
|
|
92
|
+
|
|
93
|
+
Open an issue or contact the maintainer.
|
|
94
|
+
|
|
95
|
+
Thank you for contributing!
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scip-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Fast code intelligence via SCIP indexes
|
|
5
5
|
Project-URL: Homepage, https://github.com/flesler/scip-cli
|
|
6
6
|
Author: Ariel Flesler
|
|
@@ -133,6 +133,7 @@ scip-cli <command> [arguments]
|
|
|
133
133
|
- `search <pattern>` - Search symbols by name pattern (`--path`)
|
|
134
134
|
- `symbols <file>` - List all symbols in a file (`--path`; bare filename OK)
|
|
135
135
|
- `rdeps <file>` - Find files that depend on a file (`--path`)
|
|
136
|
+
- `deps <symbol|file>` - Find outbound dependencies (what a symbol or file calls) (`--path`, `--paths-only`)
|
|
136
137
|
- `members <symbol>` - List members of a class/interface (`--path`)
|
|
137
138
|
- `analyze [target]` - SQL health dashboards (`--limit`, `--priority`, `--include-tests`). No target: project-wide; directory or file path; symbol name. See [Finding easy wins with `analyze`](#finding-easy-wins-with-analyze).
|
|
138
139
|
- `reindex` - Force re-indexing of the current project (`--path` to limit scope; repeatable)
|
|
@@ -159,6 +160,12 @@ scip-cli symbols helper.ts
|
|
|
159
160
|
# Find files that import from a module
|
|
160
161
|
scip-cli rdeps src/helper.ts
|
|
161
162
|
|
|
163
|
+
# Find what a function calls
|
|
164
|
+
scip-cli deps greet
|
|
165
|
+
|
|
166
|
+
# Find what a file depends on
|
|
167
|
+
scip-cli deps src/helper.ts --paths-only
|
|
168
|
+
|
|
162
169
|
# List members of a class
|
|
163
170
|
scip-cli members Widget
|
|
164
171
|
|
|
@@ -171,7 +178,7 @@ scip-cli skill ~/.claude/skills/scip-cli/SKILL.md
|
|
|
171
178
|
|
|
172
179
|
### Pipelines
|
|
173
180
|
|
|
174
|
-
Stdout is one record per line; stderr carries warnings and ambiguity notices. Kinds are lowercase (`function`, `class`, `method`, `property`). Pipe-friendly flags: `refs --paths-only`, `search --names-only` / `--paths-only`, `members --names-only`. `rdeps` already prints bare file paths.
|
|
181
|
+
Stdout is one record per line; stderr carries warnings and ambiguity notices. Kinds are lowercase (`function`, `class`, `method`, `property`). Pipe-friendly flags: `refs --paths-only`, `search --names-only` / `--paths-only`, `members --names-only`, `deps --paths-only`. `rdeps` already prints bare file paths.
|
|
175
182
|
|
|
176
183
|
```bash
|
|
177
184
|
# What do importers of this file export?
|
|
@@ -185,6 +192,9 @@ scip-cli search Handler --kind class --names-only | xargs -I{} scip-cli members
|
|
|
185
192
|
|
|
186
193
|
# Walk class members to their definitions
|
|
187
194
|
scip-cli members Widget --names-only | xargs -I{} scip-cli code Widget.{}
|
|
195
|
+
|
|
196
|
+
# Find all files that a symbol depends on (outbound dependencies)
|
|
197
|
+
scip-cli deps greet --paths-only | sort -u
|
|
188
198
|
```
|
|
189
199
|
|
|
190
200
|
## How It Works
|
|
@@ -270,7 +280,7 @@ scip-cli analyze scip_cli --limit 15 # directory: scoped project +
|
|
|
270
280
|
|
|
271
281
|
**Defaults:** project-wide and directory analyze skip `tests/`, `*.test.*`, `*.spec.*`, `conftest.py`, and `__tests__/`. Pass `--include-tests` to include them. File-target analyze always includes that file.
|
|
272
282
|
|
|
273
|
-
**Limits:**
|
|
283
|
+
**Limits:** "Dead export" means no cross-file mentions in the index — not unreachable code. Same-file private helpers are expected. Re-run `reindex` after large changes; the index is a snapshot.
|
|
274
284
|
|
|
275
285
|
## Performance
|
|
276
286
|
|
|
@@ -332,6 +342,14 @@ SCIP_CLI_DEBUG=1 scip-cli refs MyFunction
|
|
|
332
342
|
|
|
333
343
|
This is useful for testing and debugging SQL queries
|
|
334
344
|
|
|
345
|
+
## Contributing
|
|
346
|
+
|
|
347
|
+
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. By participating, you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
348
|
+
|
|
349
|
+
## Security
|
|
350
|
+
|
|
351
|
+
To report a security vulnerability, see [SECURITY.md](SECURITY.md).
|
|
352
|
+
|
|
335
353
|
## License
|
|
336
354
|
|
|
337
355
|
MIT
|
|
@@ -113,6 +113,7 @@ scip-cli <command> [arguments]
|
|
|
113
113
|
- `search <pattern>` - Search symbols by name pattern (`--path`)
|
|
114
114
|
- `symbols <file>` - List all symbols in a file (`--path`; bare filename OK)
|
|
115
115
|
- `rdeps <file>` - Find files that depend on a file (`--path`)
|
|
116
|
+
- `deps <symbol|file>` - Find outbound dependencies (what a symbol or file calls) (`--path`, `--paths-only`)
|
|
116
117
|
- `members <symbol>` - List members of a class/interface (`--path`)
|
|
117
118
|
- `analyze [target]` - SQL health dashboards (`--limit`, `--priority`, `--include-tests`). No target: project-wide; directory or file path; symbol name. See [Finding easy wins with `analyze`](#finding-easy-wins-with-analyze).
|
|
118
119
|
- `reindex` - Force re-indexing of the current project (`--path` to limit scope; repeatable)
|
|
@@ -139,6 +140,12 @@ scip-cli symbols helper.ts
|
|
|
139
140
|
# Find files that import from a module
|
|
140
141
|
scip-cli rdeps src/helper.ts
|
|
141
142
|
|
|
143
|
+
# Find what a function calls
|
|
144
|
+
scip-cli deps greet
|
|
145
|
+
|
|
146
|
+
# Find what a file depends on
|
|
147
|
+
scip-cli deps src/helper.ts --paths-only
|
|
148
|
+
|
|
142
149
|
# List members of a class
|
|
143
150
|
scip-cli members Widget
|
|
144
151
|
|
|
@@ -151,7 +158,7 @@ scip-cli skill ~/.claude/skills/scip-cli/SKILL.md
|
|
|
151
158
|
|
|
152
159
|
### Pipelines
|
|
153
160
|
|
|
154
|
-
Stdout is one record per line; stderr carries warnings and ambiguity notices. Kinds are lowercase (`function`, `class`, `method`, `property`). Pipe-friendly flags: `refs --paths-only`, `search --names-only` / `--paths-only`, `members --names-only`. `rdeps` already prints bare file paths.
|
|
161
|
+
Stdout is one record per line; stderr carries warnings and ambiguity notices. Kinds are lowercase (`function`, `class`, `method`, `property`). Pipe-friendly flags: `refs --paths-only`, `search --names-only` / `--paths-only`, `members --names-only`, `deps --paths-only`. `rdeps` already prints bare file paths.
|
|
155
162
|
|
|
156
163
|
```bash
|
|
157
164
|
# What do importers of this file export?
|
|
@@ -165,6 +172,9 @@ scip-cli search Handler --kind class --names-only | xargs -I{} scip-cli members
|
|
|
165
172
|
|
|
166
173
|
# Walk class members to their definitions
|
|
167
174
|
scip-cli members Widget --names-only | xargs -I{} scip-cli code Widget.{}
|
|
175
|
+
|
|
176
|
+
# Find all files that a symbol depends on (outbound dependencies)
|
|
177
|
+
scip-cli deps greet --paths-only | sort -u
|
|
168
178
|
```
|
|
169
179
|
|
|
170
180
|
## How It Works
|
|
@@ -250,7 +260,7 @@ scip-cli analyze scip_cli --limit 15 # directory: scoped project +
|
|
|
250
260
|
|
|
251
261
|
**Defaults:** project-wide and directory analyze skip `tests/`, `*.test.*`, `*.spec.*`, `conftest.py`, and `__tests__/`. Pass `--include-tests` to include them. File-target analyze always includes that file.
|
|
252
262
|
|
|
253
|
-
**Limits:**
|
|
263
|
+
**Limits:** "Dead export" means no cross-file mentions in the index — not unreachable code. Same-file private helpers are expected. Re-run `reindex` after large changes; the index is a snapshot.
|
|
254
264
|
|
|
255
265
|
## Performance
|
|
256
266
|
|
|
@@ -312,6 +322,14 @@ SCIP_CLI_DEBUG=1 scip-cli refs MyFunction
|
|
|
312
322
|
|
|
313
323
|
This is useful for testing and debugging SQL queries
|
|
314
324
|
|
|
325
|
+
## Contributing
|
|
326
|
+
|
|
327
|
+
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. By participating, you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
328
|
+
|
|
329
|
+
## Security
|
|
330
|
+
|
|
331
|
+
To report a security vulnerability, see [SECURITY.md](SECURITY.md).
|
|
332
|
+
|
|
315
333
|
## License
|
|
316
334
|
|
|
317
335
|
MIT
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------- | ------------------ |
|
|
7
|
+
| latest | :white_check_mark: |
|
|
8
|
+
| < latest| :x: |
|
|
9
|
+
|
|
10
|
+
## Reporting a Vulnerability
|
|
11
|
+
|
|
12
|
+
**Do not open public issues for security vulnerabilities.**
|
|
13
|
+
|
|
14
|
+
If you discover a security vulnerability, please email **ariel.flesler@gmail.com** with:
|
|
15
|
+
|
|
16
|
+
- Description of the vulnerability
|
|
17
|
+
- Steps to reproduce or proof of concept
|
|
18
|
+
- Potential impact
|
|
19
|
+
- Suggested fix (if any)
|
|
20
|
+
|
|
21
|
+
## What to Expect
|
|
22
|
+
|
|
23
|
+
- Acknowledgment within 48 hours
|
|
24
|
+
- Assessment of the vulnerability's severity and impact
|
|
25
|
+
- Timeline for a fix and release
|
|
26
|
+
- Credit in the release notes (unless you prefer to remain anonymous)
|
|
27
|
+
|
|
28
|
+
## Scope
|
|
29
|
+
|
|
30
|
+
Security considerations for scip-cli include:
|
|
31
|
+
|
|
32
|
+
- **Index integrity**: SCIP indexes are read from local filesystem and trusted
|
|
33
|
+
- **SQL injection**: All queries use parameterized statements
|
|
34
|
+
- **Path traversal**: File operations are scoped to the indexed project
|
|
35
|
+
- **Dependency security**: Minimal dependencies; pinned versions in `pyproject.toml`
|
|
36
|
+
|
|
37
|
+
## Security Best Practices for Users
|
|
38
|
+
|
|
39
|
+
- Install from PyPI: `pip install scip-cli` (verified releases)
|
|
40
|
+
- Keep scip-cli updated to the latest version
|
|
41
|
+
- Review `.scip-cli.json` configuration before use in untrusted projects
|
|
42
|
+
- The `scip` binary is downloaded from [official releases](https://github.com/scip-code/scip/releases)
|
|
43
|
+
|
|
44
|
+
## Responsible Disclosure
|
|
45
|
+
|
|
46
|
+
We appreciate responsible disclosure and will work with you to understand and address the issue promptly.
|
|
@@ -18,6 +18,7 @@ All commands are sub-commands of `scip-cli`. Run from the project root.
|
|
|
18
18
|
| "What's in this file?" | `symbols file` | Up to `--limit` symbols (default 10). Bare filename works (`helper.ts`) |
|
|
19
19
|
| "Find symbols by name" | `search name` | Functions, types, interfaces, classes |
|
|
20
20
|
| "What files depend on this file?" | `rdeps file` | Importers — bare name works |
|
|
21
|
+
| "What does this symbol/file depend on?" | `deps target` | Outbound dependencies — symbols referenced within a function or file |
|
|
21
22
|
| "What methods does this class have?" | `members ClassName` | All methods/fields with line ranges |
|
|
22
23
|
| "Health / risk / stale code?" | `analyze` | Multi-section SQL dashboard — omit target (project), pass file, or symbol |
|
|
23
24
|
|
|
@@ -70,8 +71,9 @@ Commands emit one record per line on stdout; warnings and progress go to stderr.
|
|
|
70
71
|
| Find functions, show callers | `scip-cli search Publish --kind function --names-only \| xargs -I{} scip-cli refs {} --paths-only` |
|
|
71
72
|
| Files touching a topic | `scip-cli search Dynamo --paths-only` |
|
|
72
73
|
| Count importers | `scip-cli rdeps file.ts \| wc -l` |
|
|
74
|
+
| Outbound dependency files | `scip-cli deps file.ts --paths-only` |
|
|
73
75
|
|
|
74
|
-
`rdeps` already prints bare paths. `refs` defaults to `path:line`; add `--paths-only` to dedupe files. `search` / `members` need `--names-only` or `--paths-only` instead of `awk`.
|
|
76
|
+
`rdeps` already prints bare paths. `deps --paths-only` deduplicates to unique files. `refs` defaults to `path:line`; add `--paths-only` to dedupe files. `search` / `members` need `--names-only` or `--paths-only` instead of `awk`.
|
|
75
77
|
|
|
76
78
|
Each `xargs` invocation reopens the index (fast on cache hit). Use `--limit` on the first command to cap fan-out.
|
|
77
79
|
|
|
@@ -105,6 +107,20 @@ Returns list of files that import from this file.
|
|
|
105
107
|
|
|
106
108
|
Default `--limit` is 10.
|
|
107
109
|
|
|
110
|
+
### deps
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
deps [--limit N] [--path PATH] [--paths-only] <symbol|file>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Returns outbound dependencies — symbols referenced within a function/method or file.
|
|
117
|
+
|
|
118
|
+
For a symbol target, finds all symbols mentioned within the definition range (function body). For a file target, finds all external symbols referenced in that file (excluding the file's own symbols).
|
|
119
|
+
|
|
120
|
+
Output format: `file:line symbolName` for each dependency. Use `--paths-only` to output unique file paths only (pipe-friendly).
|
|
121
|
+
|
|
122
|
+
Default `--limit` is 10.
|
|
123
|
+
|
|
108
124
|
### members
|
|
109
125
|
|
|
110
126
|
```bash
|
|
@@ -9,7 +9,7 @@ import sys
|
|
|
9
9
|
|
|
10
10
|
from . import __version__
|
|
11
11
|
from .cli_args import add_limit_argument, add_names_only_argument, add_path_argument, add_paths_only_argument
|
|
12
|
-
from .commands import analyze, code, members, rdeps, refs, reindex, search, skill, symbols
|
|
12
|
+
from .commands import analyze, code, deps, members, rdeps, refs, reindex, search, skill, symbols
|
|
13
13
|
from .symbols import SymbolKind
|
|
14
14
|
|
|
15
15
|
# Set up debug logging based on SCIP_CLI_DEBUG env var
|
|
@@ -93,6 +93,13 @@ def main():
|
|
|
93
93
|
add_path_argument(rdeps_parser)
|
|
94
94
|
rdeps_parser.add_argument("file", help="File path or pattern")
|
|
95
95
|
|
|
96
|
+
# deps
|
|
97
|
+
deps_parser = subparsers.add_parser("deps", help="Find outbound dependencies (what a symbol/file calls)")
|
|
98
|
+
add_limit_argument(deps_parser, default=10, help_suffix="dependencies")
|
|
99
|
+
add_path_argument(deps_parser)
|
|
100
|
+
add_paths_only_argument(deps_parser)
|
|
101
|
+
deps_parser.add_argument("target", help="Symbol name or file path")
|
|
102
|
+
|
|
96
103
|
# members
|
|
97
104
|
members_parser = subparsers.add_parser("members", help="List members of a class/interface")
|
|
98
105
|
add_limit_argument(members_parser, default=10, help_suffix="members")
|
|
@@ -150,6 +157,7 @@ def main():
|
|
|
150
157
|
"search": search.main,
|
|
151
158
|
"symbols": symbols.main,
|
|
152
159
|
"rdeps": rdeps.main,
|
|
160
|
+
"deps": deps.main,
|
|
153
161
|
"members": members.main,
|
|
154
162
|
"skill": skill.main,
|
|
155
163
|
"analyze": analyze.main,
|
|
@@ -39,7 +39,7 @@ def add_paths_only_argument(parser: argparse.ArgumentParser) -> None:
|
|
|
39
39
|
parser.add_argument(
|
|
40
40
|
"--paths-only",
|
|
41
41
|
action="store_true",
|
|
42
|
-
help="Print unique file paths only (one per line, for piping to symbols/rdeps)",
|
|
42
|
+
help="Print unique file paths only (one per line, for piping to symbols/rdeps/deps)",
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"""deps command - find outbound dependencies (what a symbol/file calls)."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from ..cli_args import path_scope_from_args
|
|
6
|
+
from ..output import limit_and_warn
|
|
7
|
+
from ..paths import path_in_scope
|
|
8
|
+
from ..queries import debug_execute
|
|
9
|
+
from ..session import resolve_one_file, resolve_one_symbol, setup
|
|
10
|
+
from ..symbols import extract_leaf_name
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _deps_from_symbol(db, symbol_id, limit):
|
|
14
|
+
"""Find all symbols referenced within this symbol's definition range."""
|
|
15
|
+
def_range = debug_execute(
|
|
16
|
+
db,
|
|
17
|
+
"""
|
|
18
|
+
SELECT document_id, start_line, end_line
|
|
19
|
+
FROM defn_enclosing_ranges
|
|
20
|
+
WHERE symbol_id = ?
|
|
21
|
+
LIMIT 1
|
|
22
|
+
""",
|
|
23
|
+
(symbol_id,),
|
|
24
|
+
).fetchone()
|
|
25
|
+
|
|
26
|
+
if not def_range:
|
|
27
|
+
return []
|
|
28
|
+
|
|
29
|
+
doc_id, start_line, end_line = def_range
|
|
30
|
+
|
|
31
|
+
# Find chunks that overlap with the function range
|
|
32
|
+
# A chunk overlaps if: chunk.start <= func.end AND chunk.end >= func.start
|
|
33
|
+
return debug_execute(
|
|
34
|
+
db,
|
|
35
|
+
"""
|
|
36
|
+
SELECT DISTINCT gs.id, gs.symbol, gs.display_name,
|
|
37
|
+
def_d.relative_path, def_der.start_line
|
|
38
|
+
FROM mentions m
|
|
39
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
40
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
41
|
+
LEFT JOIN defn_enclosing_ranges def_der ON def_der.symbol_id = gs.id
|
|
42
|
+
LEFT JOIN documents def_d ON def_der.document_id = def_d.id
|
|
43
|
+
WHERE c.document_id = ?
|
|
44
|
+
AND c.start_line <= ?
|
|
45
|
+
AND c.end_line >= ?
|
|
46
|
+
AND m.role != 1
|
|
47
|
+
AND gs.id != ?
|
|
48
|
+
ORDER BY gs.symbol
|
|
49
|
+
LIMIT ?
|
|
50
|
+
""",
|
|
51
|
+
(doc_id, end_line, start_line, symbol_id, limit + 1),
|
|
52
|
+
).fetchall()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _deps_from_file(db, file_path, limit):
|
|
56
|
+
"""Find all symbols referenced within this file (excluding file's own symbols)."""
|
|
57
|
+
doc_row = debug_execute(
|
|
58
|
+
db,
|
|
59
|
+
"SELECT id FROM documents WHERE relative_path = ?",
|
|
60
|
+
(file_path,),
|
|
61
|
+
).fetchone()
|
|
62
|
+
|
|
63
|
+
if not doc_row:
|
|
64
|
+
return []
|
|
65
|
+
|
|
66
|
+
doc_id = doc_row[0]
|
|
67
|
+
|
|
68
|
+
# Exclude own symbols via SQL subquery instead of Python filtering
|
|
69
|
+
return debug_execute(
|
|
70
|
+
db,
|
|
71
|
+
"""
|
|
72
|
+
SELECT DISTINCT gs.id, gs.symbol, gs.display_name,
|
|
73
|
+
def_d.relative_path, def_der.start_line
|
|
74
|
+
FROM mentions m
|
|
75
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
76
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
77
|
+
LEFT JOIN defn_enclosing_ranges def_der ON def_der.symbol_id = gs.id
|
|
78
|
+
LEFT JOIN documents def_d ON def_der.document_id = def_d.id
|
|
79
|
+
WHERE c.document_id = ?
|
|
80
|
+
AND m.role != 1
|
|
81
|
+
AND gs.id NOT IN (
|
|
82
|
+
SELECT der2.symbol_id FROM defn_enclosing_ranges der2
|
|
83
|
+
WHERE der2.document_id = ?
|
|
84
|
+
)
|
|
85
|
+
ORDER BY gs.symbol
|
|
86
|
+
LIMIT ?
|
|
87
|
+
""",
|
|
88
|
+
(doc_id, doc_id, limit + 1),
|
|
89
|
+
).fetchall()
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def main(args):
|
|
93
|
+
"""Find outbound dependencies of a symbol or file."""
|
|
94
|
+
db, project_root = setup()
|
|
95
|
+
try:
|
|
96
|
+
path_scope = path_scope_from_args(args, project_root)
|
|
97
|
+
limit = args.limit
|
|
98
|
+
target = args.target
|
|
99
|
+
paths_only = getattr(args, "paths_only", False)
|
|
100
|
+
|
|
101
|
+
deps = []
|
|
102
|
+
target_label = target
|
|
103
|
+
|
|
104
|
+
if target.endswith((".ts", ".tsx", ".js", ".jsx", ".py")):
|
|
105
|
+
file_path = resolve_one_file(db, target, path_scope=path_scope)
|
|
106
|
+
deps = _deps_from_file(db, file_path, limit)
|
|
107
|
+
target_label = file_path
|
|
108
|
+
else:
|
|
109
|
+
symbol_id, _symbol_str, _display = resolve_one_symbol(
|
|
110
|
+
db,
|
|
111
|
+
target,
|
|
112
|
+
path_scope=path_scope,
|
|
113
|
+
)
|
|
114
|
+
deps = _deps_from_symbol(db, symbol_id, limit)
|
|
115
|
+
|
|
116
|
+
if not deps:
|
|
117
|
+
print(f"No dependencies found for '{target_label}'", file=sys.stderr)
|
|
118
|
+
sys.exit(1)
|
|
119
|
+
|
|
120
|
+
deps = limit_and_warn(deps, limit, "dependencies")
|
|
121
|
+
|
|
122
|
+
if paths_only:
|
|
123
|
+
seen_paths = set()
|
|
124
|
+
for _sym_id, _symbol, _display, def_path, _def_line in deps:
|
|
125
|
+
if def_path and def_path not in seen_paths and path_in_scope(def_path, path_scope):
|
|
126
|
+
seen_paths.add(def_path)
|
|
127
|
+
|
|
128
|
+
if not seen_paths:
|
|
129
|
+
print(f"No dependency files found for '{target_label}'", file=sys.stderr)
|
|
130
|
+
sys.exit(1)
|
|
131
|
+
|
|
132
|
+
for path in sorted(seen_paths):
|
|
133
|
+
print(path)
|
|
134
|
+
return
|
|
135
|
+
|
|
136
|
+
for _sym_id, symbol, display, def_path, def_line in deps:
|
|
137
|
+
name = display if display else extract_leaf_name(symbol)
|
|
138
|
+
|
|
139
|
+
if def_path and path_in_scope(def_path, path_scope):
|
|
140
|
+
print(f"{def_path}:{def_line + 1} {name}")
|
|
141
|
+
else:
|
|
142
|
+
print(name)
|
|
143
|
+
finally:
|
|
144
|
+
db.close()
|
|
@@ -22,6 +22,9 @@ case "$BUMP" in
|
|
|
22
22
|
;;
|
|
23
23
|
esac
|
|
24
24
|
|
|
25
|
+
# Run tests first
|
|
26
|
+
./scripts/test.sh
|
|
27
|
+
|
|
25
28
|
if [[ -n "$BUMP" ]]; then
|
|
26
29
|
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
|
|
27
30
|
echo "Error: working tree has uncommitted changes; commit or stash before bumping"
|
|
@@ -67,10 +70,7 @@ PY
|
|
|
67
70
|
git commit -m "Release $NEW_VERSION."
|
|
68
71
|
fi
|
|
69
72
|
|
|
70
|
-
#
|
|
71
|
-
./scripts/test.sh
|
|
72
|
-
|
|
73
|
-
# Build
|
|
73
|
+
# Build (after version bump so dist/ has correct version)
|
|
74
74
|
./scripts/build.sh
|
|
75
75
|
|
|
76
76
|
# Get version from package
|
|
@@ -18,6 +18,7 @@ FIXTURE_ROOT = Path(__file__).parent / "fixtures" / "sample-project"
|
|
|
18
18
|
COMMAND_SETUP_PATHS = (
|
|
19
19
|
"scip_cli.commands.analyze.setup",
|
|
20
20
|
"scip_cli.commands.code.setup",
|
|
21
|
+
"scip_cli.commands.deps.setup",
|
|
21
22
|
"scip_cli.commands.members.setup",
|
|
22
23
|
"scip_cli.commands.refs.setup",
|
|
23
24
|
"scip_cli.commands.rdeps.setup",
|
|
@@ -150,6 +150,25 @@ class TestRdeps:
|
|
|
150
150
|
assert CONSUMER_FILE in result.stdout or WIDGET_FILE in result.stdout
|
|
151
151
|
|
|
152
152
|
|
|
153
|
+
class TestDeps:
|
|
154
|
+
def test_symbol_deps(self, cli):
|
|
155
|
+
result = cli.run("deps", "useWidget", "--limit", "10")
|
|
156
|
+
assert result.returncode == 0
|
|
157
|
+
assert "Widget" in result.stdout or "greet" in result.stdout
|
|
158
|
+
|
|
159
|
+
def test_file_deps(self, cli):
|
|
160
|
+
result = cli.run("deps", USER_FILE, "--limit", "10")
|
|
161
|
+
assert result.returncode == 0
|
|
162
|
+
assert "Widget" in result.stdout or "greet" in result.stdout
|
|
163
|
+
|
|
164
|
+
def test_paths_only(self, cli):
|
|
165
|
+
result = cli.run("deps", USER_FILE, "--paths-only", "--limit", "10")
|
|
166
|
+
assert result.returncode == 0
|
|
167
|
+
assert WIDGET_FILE in result.stdout
|
|
168
|
+
# Should not contain line numbers in paths-only mode
|
|
169
|
+
assert ":" not in result.stdout
|
|
170
|
+
|
|
171
|
+
|
|
153
172
|
class TestAnalyze:
|
|
154
173
|
def test_project_dashboard(self, cli):
|
|
155
174
|
result = cli.run("analyze", "--limit", "5")
|
|
@@ -29,6 +29,7 @@ class TestE2eCommandPerf:
|
|
|
29
29
|
"refs": _time_cli(cli, "refs", FN_GREET, "--paths-only", "--limit", "10"),
|
|
30
30
|
"members": _time_cli(cli, "members", CLASS_WIDGET, "--names-only"),
|
|
31
31
|
"rdeps": _time_cli(cli, "rdeps", HELPER_FILE, "--limit", "10"),
|
|
32
|
+
"deps": _time_cli(cli, "deps", FN_GREET, "--limit", "10"),
|
|
32
33
|
}
|
|
33
34
|
analyze_high = _time_cli(cli, "analyze", "--priority", "high", "--limit", "5")
|
|
34
35
|
analyze_all = _time_cli(cli, "analyze", "--limit", "5")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/domain/i18n/useLocale.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scip_cli-2.2.1 → scip_cli-2.3.0}/tests/fixtures/sample-project/src/integrations/inferenceClient.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|