Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: lint

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

workflow_dispatch:

Expand All @@ -13,8 +13,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v6
- uses: actions/setup-python@v5

- name: Install ufmt
run: pip install ufmt==2.8.0 black==24.4.2 ruff-api==0.1.0
Expand All @@ -29,11 +29,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v6
- uses: actions/setup-python@v5

- name: Install flake8
run: pip install flake8==6.1.0
run: pip install flake8==7.1.0

- name: Run flake8
run: flake8
Expand All @@ -42,7 +42,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install packages and run ESLint
run: |
Expand Down
6 changes: 3 additions & 3 deletions sapp/db_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,9 @@ def get(self, cls: Type[object]) -> int:
assert next_id <= max_id, (
"%s reserved primary key range exhausted" % cls.__name__
)
assert (
next_id in self.allowed_id_range
), f"{cls.__name__} primary key was outside the allowed {self.allowed_id_range}"
assert next_id in self.allowed_id_range, (
f"{cls.__name__} primary key was outside the allowed {self.allowed_id_range}"
)

self.pks[cls.__name__] = (next_id + 1, max_id)
return next_id
3 changes: 1 addition & 2 deletions sapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ class IssueInstanceSharedTextAssoc(Base, PrepareMixin, RecordMixin):
issue_instance = relationship(
"IssueInstance",
primaryjoin=(
"IssueInstanceSharedTextAssoc.issue_instance_id =="
"foreign(IssueInstance.id)"
"IssueInstanceSharedTextAssoc.issue_instance_id ==foreign(IssueInstance.id)"
),
uselist=False,
viewonly=True,
Expand Down
2 changes: 1 addition & 1 deletion sapp/pipeline/pysa_taint_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)

from .. import errors
from ..analysis_output import AnalysisOutput, Metadata
from ..analysis_output import AnalysisOutput
from . import (
flatten_features_to_parse_trace_feature,
ParseConditionTuple,
Expand Down
30 changes: 15 additions & 15 deletions sapp/trace_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ def get_number_issues(self) -> int:
return len(self._issues)

def add_issue_instance(self, instance: IssueInstance) -> None:
assert (
instance.id.local_id not in self._issue_instances
), "Instance already exists"
assert instance.id.local_id not in self._issue_instances, (
"Instance already exists"
)
self._issue_instances[instance.id.local_id] = instance

def get_issue_instances(self) -> Iterable[IssueInstance]:
Expand All @@ -150,24 +150,24 @@ def get_issue_instances(self) -> Iterable[IssueInstance]:
def add_issue_instance_fix_info(
self, instance: IssueInstance, fix_info: IssueInstanceFixInfo
) -> None:
assert (
instance.id.local_id not in self._issue_instance_fix_info
), "Instance fix info already exists"
assert instance.id.local_id not in self._issue_instance_fix_info, (
"Instance fix info already exists"
)
self._issue_instance_fix_info[instance.id.local_id] = fix_info

def add_class_type_interval(self, interval: ClassTypeInterval) -> None:
assert (
interval.class_name not in self._class_type_intervals
), "Class name already exists"
assert interval.class_name not in self._class_type_intervals, (
"Class name already exists"
)
self._class_type_intervals[interval.class_name] = interval

def add_meta_run_issue_instance(
self, meta_run_issue_instance: MetaRunIssueInstanceIndex
) -> None:
local_id = meta_run_issue_instance.issue_instance_id.local_id
assert (
local_id not in self._meta_run_issue_instances
), "Meta run issue instance already exists"
assert local_id not in self._meta_run_issue_instances, (
"Meta run issue instance already exists"
)
self._meta_run_issue_instances[local_id] = meta_run_issue_instance

def get_text(self, shared_text_id: DBID) -> str:
Expand Down Expand Up @@ -285,9 +285,9 @@ def get_trace_frame_from_id(self, id: int) -> TraceFrame:
return self._trace_frames[id]

def add_shared_text(self, shared_text: SharedText) -> None:
assert (
shared_text.id.local_id not in self._shared_texts
), "Shared text already exists"
assert shared_text.id.local_id not in self._shared_texts, (
"Shared text already exists"
)
assert (
shared_text.kind not in self._shared_text_lookup
or shared_text.contents not in self._shared_text_lookup[shared_text.kind]
Expand Down
Loading