-
Notifications
You must be signed in to change notification settings - Fork 9
Staging #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Staging #92
Changes from all commits
a6f9c06
ee86d66
95b5565
4c03c81
9a9c0d2
1501945
2ec120e
51c16a7
f872b26
9839abf
8b4f7e0
b4b4f81
5518d6a
7983fff
d36a37b
9d21bb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,9 @@ | |
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| branches: [ "main", "staging" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| branches: [ "main", "staging" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
@@ -19,15 +19,16 @@ | |
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python 3.10 | ||
| uses: actions/setup-python@v3 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
Comment on lines
+22
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin the action to a specific commit hash for supply chain security. Using 🔎 Proposed fix - name: Install uv
- uses: astral-sh/setup-uv@v4
+ uses: astral-sh/setup-uv@v4 # pin to commit hash after verifyingTo get the current commit hash for v4, run: #!/bin/bash
# Get the latest commit hash for the v4 tag
curl -s https://api.github.com/repos/astral-sh/setup-uv/git/refs/tags/v4 | jq -r '.object.sha'
🧰 Tools🪛 GitHub Check: CodeQL[warning] 23-23: Unpinned tag for a non-immutable Action in workflow 🤖 Prompt for AI Agents |
||
| - name: Set up Python 3.12 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.10" | ||
| python-version: "3.12" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install flake8 pytest | ||
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
| uv pip install --system flake8 pytest | ||
| uv pip install --system . | ||
| - name: Lint with flake8 | ||
| run: | | ||
| # stop the build if there are Python syntax errors or undefined names | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,31 @@ | ||
| from typing import Callable, Self | ||
| from tree_sitter import Node | ||
|
|
||
| class Symbol: | ||
| def __init__(self, symbol: Node): | ||
| self.symbol = symbol | ||
| self.resolved_symbol = set() | ||
|
|
||
| def add_resolve_symbol(self, resolved_symbol): | ||
| self.resolved_symbol.add(resolved_symbol) | ||
|
|
||
| class Entity: | ||
| def __init__(self, node: Node): | ||
| self.node = node | ||
| self.symbols: dict[str, list[Node]] = {} | ||
| self.resolved_symbols: dict[str, set[Self]] = {} | ||
| self.symbols: dict[str, list[Symbol]] = {} | ||
| self.children: dict[Node, Self] = {} | ||
|
|
||
| def add_symbol(self, key: str, symbol: Node): | ||
| if key not in self.symbols: | ||
| self.symbols[key] = [] | ||
| self.symbols[key].append(symbol) | ||
|
|
||
| def add_resolved_symbol(self, key: str, symbol: Self): | ||
| if key not in self.resolved_symbols: | ||
| self.resolved_symbols[key] = set() | ||
| self.resolved_symbols[key].add(symbol) | ||
| self.symbols[key].append(Symbol(symbol)) | ||
|
|
||
| def add_child(self, child: Self): | ||
| child.parent = self | ||
| self.children[child.node] = child | ||
|
|
||
| def resolved_symbol(self, f: Callable[[str, Node], list[Self]]): | ||
| for key, symbols in self.symbols.items(): | ||
| self.resolved_symbols[key] = set() | ||
| for symbol in symbols: | ||
| for resolved_symbol in f(key, symbol): | ||
| self.resolved_symbols[key].add(resolved_symbol) | ||
| for resolved_symbol in f(key, symbol.symbol): | ||
| symbol.add_resolve_symbol(resolved_symbol) |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium