Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e0e22a

Browse files
feat: initial release of focal v0.1.0
0 parents  commit 2e0e22a

43 files changed

Lines changed: 3225 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest]
17+
python-version: ["3.12", "3.14"]
18+
19+
steps:
20+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
21+
22+
# 1. Linux Dependency Routing
23+
- name: Install System Dependencies (Ubuntu)
24+
if: runner.os == 'Linux'
25+
run: sudo apt-get update && sudo apt-get install -y shellcheck shfmt bats
26+
27+
# 2. macOS Dependency Routing
28+
- name: Install System Dependencies (macOS)
29+
if: runner.os == 'macOS'
30+
run: brew install shellcheck shfmt bats-core
31+
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82 # v7
34+
with:
35+
enable-cache: true
36+
cache-dependency-glob: "uv.lock"
37+
python-version: ${{ matrix.python-version }}
38+
39+
- name: Install dependencies
40+
run: uv sync --group ci
41+
42+
- name: Install just
43+
uses: taiki-e/install-action@just
44+
45+
- name: Run Full CI Pipeline
46+
run: just ci

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
update-homebrew:
10+
name: Update Homebrew tap formula
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out Focal repository
14+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
15+
16+
- name: Check out Homebrew Tap
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
18+
with:
19+
repository: JacksonFergusonDev/homebrew-tap
20+
token: ${{ secrets.TAP_GITHUB_TOKEN }}
21+
path: homebrew-tap
22+
23+
- name: Set up Homebrew
24+
uses: Homebrew/actions/setup-homebrew@9926e3be887aa6c9523a027099bf5e882056f5c1
25+
26+
- name: Tap the repository
27+
run: brew tap JacksonFergusonDev/homebrew-tap ./homebrew-tap
28+
29+
- name: Bump formula URL and SHA
30+
working-directory: homebrew-tap
31+
env:
32+
TAG: ${{ github.ref_name }}
33+
run: |
34+
set -euo pipefail
35+
36+
FORMULA="Formula/focal.rb"
37+
BREW_TAP_DIR="$(brew --repository jacksonfergusondev/homebrew-tap)"
38+
BREW_FORMULA="$BREW_TAP_DIR/$FORMULA"
39+
40+
# 1. Construct the GitHub release tarball URL
41+
NEW_URL="https://github.com/JacksonFergusonDev/focal/archive/refs/tags/${TAG}.tar.gz"
42+
43+
# 2. Download the tarball and compute the SHA256
44+
echo "Fetching ${NEW_URL}..."
45+
curl -sL "$NEW_URL" -o release.tar.gz
46+
NEW_SHA="$(sha256sum release.tar.gz | awk '{print $1}')"
47+
rm release.tar.gz
48+
49+
if [ -z "$NEW_SHA" ]; then
50+
echo "Failed to compute SHA256 for the release tarball."
51+
exit 1
52+
fi
53+
54+
echo "New Version: $TAG"
55+
echo "New SHA256: $NEW_SHA"
56+
57+
# 3. Update formula in HOMEBREW'S internal directory
58+
sed -i "s|^ url \".*\"| url \"${NEW_URL}\"|" "$BREW_FORMULA"
59+
sed -i "s|^ sha256 \".*\"| sha256 \"${NEW_SHA}\"|" "$BREW_FORMULA"
60+
61+
# 4. Copy the fully updated formula back to the local GitHub Action workspace
62+
cp "$BREW_FORMULA" "$FORMULA"
63+
64+
# 5. Commit + push if anything changed
65+
git config user.name "github-actions[bot]"
66+
git config user.email "github-actions[bot]@users.noreply.github.com"
67+
git add "$FORMULA"
68+
69+
if git diff --cached --quiet; then
70+
echo "No formula changes to commit."
71+
exit 0
72+
fi
73+
74+
# 6. Audit the formula to ensure no syntax errors were introduced
75+
brew audit --strict --online jacksonfergusondev/homebrew-tap/focal
76+
77+
git commit -m "chore: bump focal to ${TAG}"
78+
git push

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.DS_Store
2+
.mypy_cache/
3+
.ruff_cache/
4+
.pytest_cache/
5+
htmlcov/
6+
coverage.xml
7+
coverage_annotations/
8+
coverage_report.txt
9+
__pycache__/
10+
.venv/
11+
.coverage
12+
.vscode/
13+
.envrc
14+
_LAB_STATUS.md

.markdownlint-cli2.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
gitignore: true
2+
3+
config:
4+
5+
# Inherit default rules
6+
default: true
7+
8+
# --- Disabled Rules ---
9+
10+
# MD013: Line length
11+
# Rationale: Hard-wrapping text disrupts IDE reading flow, breaks URLs, and creates arbitrary diff churn.
12+
MD013: false
13+
14+
# MD033: Inline HTML
15+
# Rationale: Required for layout elements unsupported by strict Markdown (e.g., <details> blocks, complex tables).
16+
MD033: false
17+
18+
# --- Refined Rules ---
19+
20+
# MD024: Multiple headings with the same content
21+
# Rationale: Allows duplicate subheadings (e.g., "Parameters") under different primary function headings.
22+
MD024:
23+
siblings_only: true
24+
25+
# --- AST/Parser Enforcement ---
26+
27+
# MD031: Fenced code blocks should be surrounded by blank lines
28+
# Rationale: Prevents strict parsers from rendering backticks as raw text instead of <pre><code> blocks.
29+
MD031: true
30+
31+
# MD032: Lists should be surrounded by blank lines
32+
# Rationale: Prevents contiguous text from merging into lists, ensuring correct AST generation.
33+
MD032: true
34+
35+
# --- Structural Consistency ---
36+
37+
# MD003: Heading style
38+
# Rationale: Enforces ATX style (# Heading) exclusively.
39+
MD003:
40+
style: "atx"
41+
42+
# MD004: Unordered list style
43+
# Rationale: Enforces dash markers for consistency across the syntax tree.
44+
MD004:
45+
style: "dash"
46+
47+
# MD009: Trailing spaces
48+
# Rationale: Allows exactly two spaces for hard line breaks; flags arbitrary whitespace.
49+
MD009:
50+
br_spaces: 2
51+
strict: false
52+
53+
# MD029: Ordered list item prefix
54+
# Rationale: Enforces the "one" style (1., 1., 1.) to minimize Git diff noise when rearranging list items.
55+
MD029:
56+
style: "one"

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
repos:
2+
# 1. Generic hooks (configured to IGNORE Python)
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v6.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
exclude: \.py$
8+
- id: end-of-file-fixer
9+
exclude: \.py$
10+
- id: check-yaml
11+
- id: check-added-large-files
12+
13+
# 2. Python-specific toolchain
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.15.9
16+
hooks:
17+
- id: ruff-format
18+
- id: ruff
19+
args: [ --fix ]
20+
21+
- repo: https://github.com/pre-commit/mirrors-mypy
22+
rev: v1.20.0
23+
hooks:
24+
- id: mypy
25+
26+
# 3. Shell linting
27+
- repo: https://github.com/shellcheck-py/shellcheck-py
28+
rev: v0.11.0.1
29+
hooks:
30+
- id: shellcheck
31+
args: ["--severity=warning"]
32+
files: \.(sh|bash)$
33+
34+
- repo: https://github.com/scop/pre-commit-shfmt
35+
rev: v3.13.0-1
36+
hooks:
37+
- id: shfmt
38+
args: ["-w", "-s", "-i", "2", "-ci"]
39+
exclude: \.bats$
40+
41+
# 4. Markdown linting
42+
- repo: https://github.com/DavidAnson/markdownlint-cli2
43+
rev: v0.22.0
44+
hooks:
45+
- id: markdownlint-cli2
46+
args: ["--fix"]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.14

.shellcheckrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Enforce a specific bash version (3.2 is the macOS default)
2+
# This will flag things like associative arrays (declare -A)
3+
shell=bash
4+
5+
# Enforce strictness
6+
external-sources=true
7+
source-path=SCRIPTDIR

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Jackson Ferguson
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)