focal-rs 0.5.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.
Files changed (82) hide show
  1. focal_rs-0.5.0/.github/ISSUE_TEMPLATE/bug_report.yml +68 -0
  2. focal_rs-0.5.0/.github/ISSUE_TEMPLATE/feature_request.yml +36 -0
  3. focal_rs-0.5.0/.github/renovate.json +60 -0
  4. focal_rs-0.5.0/.github/workflows/ci.yml +207 -0
  5. focal_rs-0.5.0/.github/workflows/release.yml +340 -0
  6. focal_rs-0.5.0/.gitignore +17 -0
  7. focal_rs-0.5.0/.pre-commit-config.yaml +89 -0
  8. focal_rs-0.5.0/.rumdl.toml +31 -0
  9. focal_rs-0.5.0/CODE_OF_CONDUCT.md +32 -0
  10. focal_rs-0.5.0/Cargo.lock +3047 -0
  11. focal_rs-0.5.0/Cargo.toml +51 -0
  12. focal_rs-0.5.0/LICENSE +21 -0
  13. focal_rs-0.5.0/PKG-INFO +374 -0
  14. focal_rs-0.5.0/README.md +354 -0
  15. focal_rs-0.5.0/assets/logo.svg +12 -0
  16. focal_rs-0.5.0/assets/readme-dark.svg +112 -0
  17. focal_rs-0.5.0/assets/readme-light.svg +119 -0
  18. focal_rs-0.5.0/branding/readme-dark-source.svg +23 -0
  19. focal_rs-0.5.0/branding/readme-light-source.svg +24 -0
  20. focal_rs-0.5.0/cliff.toml +42 -0
  21. focal_rs-0.5.0/docs/rust-migration.md +371 -0
  22. focal_rs-0.5.0/justfile +102 -0
  23. focal_rs-0.5.0/pyproject.toml +30 -0
  24. focal_rs-0.5.0/src/ci_fail/logs.rs +403 -0
  25. focal_rs-0.5.0/src/ci_fail.rs +439 -0
  26. focal_rs-0.5.0/src/cli.rs +358 -0
  27. focal_rs-0.5.0/src/clipboard.rs +69 -0
  28. focal_rs-0.5.0/src/completions.rs +87 -0
  29. focal_rs-0.5.0/src/context.rs +99 -0
  30. focal_rs-0.5.0/src/diff.rs +506 -0
  31. focal_rs-0.5.0/src/discovery.rs +81 -0
  32. focal_rs-0.5.0/src/file.rs +222 -0
  33. focal_rs-0.5.0/src/git.rs +260 -0
  34. focal_rs-0.5.0/src/github/call.rs +106 -0
  35. focal_rs-0.5.0/src/github/download.rs +81 -0
  36. focal_rs-0.5.0/src/github/mod.rs +614 -0
  37. focal_rs-0.5.0/src/issues.rs +255 -0
  38. focal_rs-0.5.0/src/local.rs +193 -0
  39. focal_rs-0.5.0/src/main.rs +128 -0
  40. focal_rs-0.5.0/src/noise.json +54 -0
  41. focal_rs-0.5.0/src/notebook.rs +190 -0
  42. focal_rs-0.5.0/src/output.rs +63 -0
  43. focal_rs-0.5.0/src/pdf.rs +346 -0
  44. focal_rs-0.5.0/src/picker.rs +701 -0
  45. focal_rs-0.5.0/src/pr_diff.rs +265 -0
  46. focal_rs-0.5.0/src/preview.rs +206 -0
  47. focal_rs-0.5.0/src/release/collect.rs +466 -0
  48. focal_rs-0.5.0/src/release/limit.rs +294 -0
  49. focal_rs-0.5.0/src/release/mod.rs +308 -0
  50. focal_rs-0.5.0/src/release/notes.rs +244 -0
  51. focal_rs-0.5.0/src/release/range.rs +289 -0
  52. focal_rs-0.5.0/src/release/report.rs +660 -0
  53. focal_rs-0.5.0/src/remote/cache.rs +280 -0
  54. focal_rs-0.5.0/src/remote/mod.rs +160 -0
  55. focal_rs-0.5.0/src/remote/sync.rs +324 -0
  56. focal_rs-0.5.0/src/search.rs +162 -0
  57. focal_rs-0.5.0/src/tree.rs +157 -0
  58. focal_rs-0.5.0/src/web.rs +211 -0
  59. focal_rs-0.5.0/src/wip.rs +309 -0
  60. focal_rs-0.5.0/tests/ci_fail.rs +484 -0
  61. focal_rs-0.5.0/tests/clipboard.rs +200 -0
  62. focal_rs-0.5.0/tests/common/mod.rs +634 -0
  63. focal_rs-0.5.0/tests/completions.rs +207 -0
  64. focal_rs-0.5.0/tests/context.rs +235 -0
  65. focal_rs-0.5.0/tests/diff.rs +369 -0
  66. focal_rs-0.5.0/tests/dispatcher.rs +146 -0
  67. focal_rs-0.5.0/tests/files.rs +488 -0
  68. focal_rs-0.5.0/tests/fixtures/ci_fail/jobs_without_step_logs.txt +11 -0
  69. focal_rs-0.5.0/tests/fixtures/ci_fail/mixed_success_run.txt +50 -0
  70. focal_rs-0.5.0/tests/fixtures/encrypted.pdf +0 -0
  71. focal_rs-0.5.0/tests/harness.rs +43 -0
  72. focal_rs-0.5.0/tests/issues.rs +422 -0
  73. focal_rs-0.5.0/tests/pdf.rs +219 -0
  74. focal_rs-0.5.0/tests/picker.rs +236 -0
  75. focal_rs-0.5.0/tests/pr_diff.rs +476 -0
  76. focal_rs-0.5.0/tests/release_context.rs +847 -0
  77. focal_rs-0.5.0/tests/release_github.rs +864 -0
  78. focal_rs-0.5.0/tests/remote.rs +690 -0
  79. focal_rs-0.5.0/tests/search.rs +281 -0
  80. focal_rs-0.5.0/tests/tree.rs +77 -0
  81. focal_rs-0.5.0/tests/web.rs +379 -0
  82. focal_rs-0.5.0/tests/wip_context.rs +320 -0
@@ -0,0 +1,68 @@
1
+ name: Bug Report
2
+ description: Report a crash, unexpected behavior, or parsing failure in Focal.
3
+ labels: ["bug"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for taking the time to file a bug report. Please provide as much diagnostic context as possible.
9
+ - type: textarea
10
+ id: description
11
+ attributes:
12
+ label: Bug Description
13
+ description: A clear and concise description of what the bug is.
14
+ placeholder: When I run `focal wip-context`, it crashes with a traceback...
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: reproduction
19
+ attributes:
20
+ label: Steps to Reproduce
21
+ description: Exactly what commands sequence caused the failure?
22
+ placeholder: |
23
+ 1. Checkout branch 'feature/xyz'
24
+ 2. Run `focal wip-context`
25
+ 3. See error
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ id: expected
30
+ attributes:
31
+ label: Expected Behavior
32
+ description: What did you expect to happen?
33
+ validations:
34
+ required: true
35
+ - type: input
36
+ id: focal-version
37
+ attributes:
38
+ label: Focal Version
39
+ description: Paste the output of `focal --version` or specify if running from source.
40
+ placeholder: "0.1.0"
41
+ validations:
42
+ required: true
43
+ - type: dropdown
44
+ id: os
45
+ attributes:
46
+ label: Operating System
47
+ options:
48
+ - macOS (Apple Silicon)
49
+ - macOS (Intel)
50
+ - Linux (Ubuntu/Debian)
51
+ - Linux (Other)
52
+ - Windows (WSL)
53
+ validations:
54
+ required: true
55
+ - type: input
56
+ id: python-version
57
+ attributes:
58
+ label: Python Version
59
+ description: Which Python version is your `uv` environment using?
60
+ placeholder: "3.12.2"
61
+ validations:
62
+ required: true
63
+ - type: textarea
64
+ id: logs
65
+ attributes:
66
+ label: Verbose Logs / Output
67
+ description: If applicable, add the output generated by running the command with the `--verbose` or `-v` flag.
68
+ render: shell
@@ -0,0 +1,36 @@
1
+ name: Feature Request
2
+ description: Suggest a new context extractor, integration, or core enhancement.
3
+ labels: ["enhancement"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Have an idea for a new `focal` command or workflow improvement? Detail the rationale and proposed implementation below.
9
+ - type: textarea
10
+ id: problem
11
+ attributes:
12
+ label: Problem Statement / Use Case
13
+ description: Is your feature request related to a specific workflow friction point?
14
+ placeholder: It is currently difficult to extract the context of a specific Dockerfile build stage...
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: solution
19
+ attributes:
20
+ label: Proposed Solution
21
+ description: Describe the technical implementation or user experience of the feature you want.
22
+ placeholder: A new `focal docker` command that parses the AST of a Dockerfile...
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: alternatives
27
+ attributes:
28
+ label: Alternatives Considered
29
+ description: Have you considered other tools or workarounds?
30
+ - type: checkboxes
31
+ id: contribute
32
+ attributes:
33
+ label: Contribution
34
+ description: Are you willing to submit a Pull Request to implement this feature?
35
+ options:
36
+ - label: Yes, I can write the PR for this.
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:best-practices",
5
+ ":semanticCommits",
6
+ ":prHourlyLimit2"
7
+ ],
8
+ "ignorePaths": [
9
+ "docs/**",
10
+ "scripts/**",
11
+ "src/**",
12
+ "tests/**"
13
+ ],
14
+ "schedule": [
15
+ "before 4am on monday"
16
+ ],
17
+ "internalChecksFilter": "strict",
18
+ "rebaseWhen": "conflicted",
19
+ "labels": [
20
+ "dependencies",
21
+ "chore"
22
+ ],
23
+ "vulnerabilityAlerts": {
24
+ "schedule": [
25
+ "at any time"
26
+ ]
27
+ },
28
+ "packageRules": [
29
+ {
30
+ "description": "Require a package to be 2 weeks old before updating, but exclude vulnerability remediation from this wait.",
31
+ "matchUpdateTypes": [
32
+ "major",
33
+ "minor",
34
+ "patch",
35
+ "pin",
36
+ "digest"
37
+ ],
38
+ "minimumReleaseAge": "2 weeks"
39
+ },
40
+ {
41
+ "description": "Group Rust dev-dependencies into one PR and automerge them.",
42
+ "matchManagers": [
43
+ "cargo"
44
+ ],
45
+ "matchDepTypes": [
46
+ "dev-dependencies"
47
+ ],
48
+ "groupName": "rust-dev-deps",
49
+ "automerge": true
50
+ },
51
+ {
52
+ "description": "Group GitHub Actions updates and automerge them.",
53
+ "matchManagers": [
54
+ "github-actions"
55
+ ],
56
+ "groupName": "github-actions",
57
+ "automerge": true
58
+ }
59
+ ]
60
+ }
@@ -0,0 +1,207 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ # Run on PRs targeting any branch so stacked PRs are checked too.
7
+ pull_request:
8
+ # Lets the release workflow run the same checks before publishing.
9
+ workflow_call:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ # Replace stale PR runs, and keep a separate run for each push to main.
15
+ concurrency:
16
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
17
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
18
+
19
+ env:
20
+ CARGO_TERM_COLOR: always
21
+
22
+ jobs:
23
+ # All OS- and architecture-agnostic checks run on a single ARM Ubuntu runner.
24
+ checks:
25
+ name: Lint, Format & Security
26
+ runs-on: ubuntu-24.04-arm
27
+ timeout-minutes: 15
28
+
29
+ steps:
30
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+ with:
32
+ persist-credentials: false
33
+
34
+ - name: Install Rust toolchain
35
+ uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
36
+ with:
37
+ toolchain: 1.100.0
38
+ components: rustfmt, clippy
39
+
40
+ - name: Cache Cargo dependencies
41
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
42
+ with:
43
+ key: checks-aarch64-unknown-linux-gnu
44
+ cache-on-failure: true
45
+ cache-all-crates: true
46
+
47
+ - name: Check Rust formatting
48
+ run: cargo fmt --all -- --check
49
+
50
+ - name: Run Clippy
51
+ run: cargo clippy --locked --all-targets -- -D warnings
52
+
53
+ - name: Lint Markdown
54
+ uses: rvben/rumdl@1e0f1d13c87418c31e0d59dacddd98f27a02efcc # v0.3.2
55
+ with:
56
+ version: "0.3.2"
57
+ report-type: annotations
58
+
59
+ - name: Validate workflows
60
+ uses: raven-actions/actionlint@3d39aea434753780c3b3d4a1a31c854b4dbf49d7 # v2.2.0
61
+ with:
62
+ version: "1.7.12"
63
+ pyflakes: false
64
+
65
+ - name: Audit workflow security
66
+ uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
67
+ with:
68
+ version: "1.32.0"
69
+ inputs: .github/
70
+ token: ${{ github.token }}
71
+ advanced-security: false
72
+ annotations: true
73
+
74
+ # Architecture-agnostic coverage check on ARM Ubuntu. The CLI contract tests run the
75
+ # instrumented binary, so end-to-end behaviour counts toward the floor.
76
+ coverage:
77
+ name: Coverage
78
+ runs-on: ubuntu-24.04-arm
79
+ timeout-minutes: 25
80
+
81
+ steps:
82
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
83
+ with:
84
+ persist-credentials: false
85
+
86
+ - name: Install Rust toolchain
87
+ uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
88
+ with:
89
+ toolchain: 1.100.0
90
+ components: llvm-tools-preview
91
+
92
+ - name: Install cargo-llvm-cov
93
+ uses: taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c # v2.90.8
94
+ with:
95
+ tool: cargo-llvm-cov
96
+
97
+ - name: Cache Cargo dependencies
98
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
99
+ with:
100
+ key: coverage-aarch64-unknown-linux-gnu
101
+ cache-on-failure: true
102
+ cache-all-crates: true
103
+
104
+ - name: Run tests with coverage floor
105
+ run: cargo llvm-cov --locked --all-targets --fail-under-lines 80
106
+
107
+ # OS- and architecture-specific test matrix. Focal relies on Unix terminals and
108
+ # file APIs, so Windows is not a supported platform.
109
+ test:
110
+ name: Test / ${{ matrix.platform }}
111
+ runs-on: ${{ matrix.os }}
112
+ timeout-minutes: 25
113
+ defaults:
114
+ run:
115
+ shell: bash
116
+ strategy:
117
+ fail-fast: false
118
+ matrix:
119
+ include:
120
+ - platform: macOS arm64
121
+ os: macos-15
122
+ target: aarch64-apple-darwin
123
+ - platform: macOS x64
124
+ os: macos-15-intel
125
+ target: x86_64-apple-darwin
126
+ - platform: Linux x64
127
+ os: ubuntu-24.04
128
+ target: x86_64-unknown-linux-gnu
129
+ - platform: Linux arm64
130
+ os: ubuntu-24.04-arm
131
+ target: aarch64-unknown-linux-gnu
132
+
133
+ steps:
134
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
135
+ with:
136
+ persist-credentials: false
137
+
138
+ - name: Install native Rust toolchain
139
+ uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
140
+ with:
141
+ toolchain: 1.100.0-${{ matrix.target }}
142
+
143
+ - name: Confirm native Rust architecture
144
+ env:
145
+ EXPECTED_TARGET: ${{ matrix.target }}
146
+ run: |
147
+ rustc -vV
148
+ test "$(rustc -vV | awk '/^host: / {print $2}' | tr -d '\r')" = "$EXPECTED_TARGET"
149
+
150
+ - name: Cache Cargo dependencies
151
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
152
+ with:
153
+ key: test-${{ matrix.target }}
154
+ cache-on-failure: true
155
+ cache-all-crates: true
156
+
157
+ - name: Run unit and CLI contract tests
158
+ run: cargo test --locked --all-targets --no-fail-fast
159
+
160
+ # The release build with no developer tools on PATH, the way users run it.
161
+ smoke:
162
+ name: Smoke test the release binary
163
+ runs-on: macos-15
164
+ timeout-minutes: 20
165
+
166
+ steps:
167
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
168
+ with:
169
+ persist-credentials: false
170
+
171
+ - name: Install Rust toolchain
172
+ uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
173
+ with:
174
+ toolchain: 1.100.0-aarch64-apple-darwin
175
+
176
+ - name: Cache Cargo dependencies
177
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
178
+ with:
179
+ key: smoke-aarch64-apple-darwin
180
+ cache-on-failure: true
181
+ cache-all-crates: true
182
+
183
+ - name: Build release binary
184
+ run: cargo build --locked --release
185
+
186
+ - name: Check linked libraries
187
+ run: |
188
+ otool -L target/release/focal
189
+ if otool -L target/release/focal | grep -E '/opt/homebrew|/usr/local|libssl|libcrypto'; then
190
+ echo "::error::binary links a non-system library"
191
+ exit 1
192
+ fi
193
+
194
+ - name: Run commands with an empty environment
195
+ run: |
196
+ focal="$PWD/target/release/focal"
197
+ work="$(mktemp -d)"
198
+ mkdir -p "$work/project/src"
199
+ echo 'def main(): pass' > "$work/project/src/app.py"
200
+ cd "$work/project"
201
+ env -i HOME="$work" "$focal" --version
202
+ env -i HOME="$work" "$focal" --commands | grep -qx wip-context
203
+ env -i HOME="$work" "$focal" tree | grep -q 'app.py'
204
+ env -i HOME="$work" "$focal" search 'def main' | grep -q 'app.py'
205
+ env -i HOME="$work" "$focal" files --all | grep -q 'def main'
206
+ "$focal" completions bash | bash -n
207
+ "$focal" completions zsh | zsh -n