Skip to content
Merged
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
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
- id: check-merge-conflict

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
3 changes: 1 addition & 2 deletions aw_core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
logger = logging.getLogger(__name__)


class VersionException(Exception):
...
class VersionException(Exception): ...


def _version_info_tuple() -> Tuple[int, int, int]: # pragma: no cover
Expand Down
8 changes: 2 additions & 6 deletions tests/test_query2.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,7 @@ def test_query2_query_functions(datastore):
eventcount = query_bucket_eventcount(bid);
asd = nop();
RETURN = {{"events": events, "eventcount": eventcount}};
""".format(
bid=bid, bid_escaped=bid.replace("'", "\\'")
)
""".format(bid=bid, bid_escaped=bid.replace("'", "\\'"))
try:
bucket = datastore.create_bucket(
bucket_id=bid, type="test", client="test", hostname="test", name="asd"
Expand Down Expand Up @@ -518,8 +516,7 @@ def test_query2_query_categorize(datastore):
starttime = iso8601.parse_date("1970")
endtime = starttime + timedelta(hours=1)

example_query = (
rf"""
example_query = rf"""
events = query_bucket("{bid}");
events = sort_by_timestamp(events);
events = categorize(events, [
Expand All @@ -529,7 +526,6 @@ def test_query2_query_categorize(datastore):
events_by_cat = merge_events_by_keys(events, ["$category"]);
RETURN = {{"events": events, "events_by_cat": events_by_cat}};
"""
)
try:
bucket = datastore.create_bucket(
bucket_id=bid, type="test", client="test", hostname="test", name="asd"
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TempTestBucket:

def __init__(self, datastore):
self.ds = datastore
self.bucket_id = f"test-{random.randint(0, 10 ** 4)}"
self.bucket_id = f"test-{random.randint(0, 10**4)}"

def __enter__(self):
self.ds.create_bucket(
Expand Down
Loading