diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..23617c0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,13 @@ +name: Lint + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + black: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: psf/black@stable diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index bf7aa78..4c25bb1 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -29,6 +29,8 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index 10dca22..d1d90c2 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,8 @@ + diff --git a/benchmark/benchmarking.py b/benchmark/benchmarking.py index 6c57884..4e8849d 100644 --- a/benchmark/benchmarking.py +++ b/benchmark/benchmarking.py @@ -1,12 +1,12 @@ import gzip import inspect +import itertools import json import math import time # noinspection PyPep8Naming from datetime import datetime as DateTime -import itertools from pathlib import Path from types import FunctionType from typing import ( @@ -18,11 +18,8 @@ Sequence, Optional, Generator, - Any, ) -import colorama - from utils import * __all__ = ( @@ -127,7 +124,8 @@ def __init__(self, name: str, identifier: str = None): self.id = mat.group("name") else: raise SyntaxError( - f'Benchmark id infer failed: only instantiation source line matching the regex "{pattern}" supports inferring.' + f"Benchmark id infer failed: only instantiation source line " + f'matching the regex "{pattern}" supports inferring.' ) Benchmark.instances.append(self) @@ -458,7 +456,7 @@ class BenchmarkMetadata: def __init__(self): log("Getting metadata...") with indent_log(): - import platform, cpuinfo, os + import platform, cpuinfo self.system = platform.system() log(f"System: {self.system}") diff --git a/benchmark/utils.py b/benchmark/utils.py index bb51f87..58985f0 100644 --- a/benchmark/utils.py +++ b/benchmark/utils.py @@ -1,7 +1,7 @@ import gc -import os import inspect import itertools +import os from contextlib import contextmanager # noinspection PyPep8Naming diff --git a/pyproject.toml b/pyproject.toml index 4db87d0..fd558b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,5 +67,6 @@ archs = ["x86_64", "arm64"] [tool.black] preview = true enable-unstable-feature = [ - "hug_parens_with_braces_and_square_brackets" + "hug_parens_with_braces_and_square_brackets", + "multiline_string_handling" ]