Skip to content

Commit

Permalink
Update black settings
Browse files Browse the repository at this point in the history
Linting workflow
  • Loading branch information
shBLOCK committed May 14, 2024
1 parent 05833d7 commit d474bd4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions benchmark/benchmarking.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -18,11 +18,8 @@
Sequence,
Optional,
Generator,
Any,
)

import colorama

from utils import *

__all__ = (
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion benchmark/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gc
import os
import inspect
import itertools
import os
from contextlib import contextmanager

# noinspection PyPep8Naming
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

0 comments on commit d474bd4

Please sign in to comment.