Skip to content

Commit 6c51702

Browse files
committed
ruff for linting & formatting
* remove defunct imports * change developer docs * ruff format & ruff check --fix
1 parent 23cc76d commit 6c51702

14 files changed

Lines changed: 14 additions & 20 deletions

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@
6767
"specversion",
6868
]
6969
frozen_locals = dict(locals())
70-
rst_epilog = '\n'.join(map(lambda x: f".. |{x}| replace:: {frozen_locals[x]}", variables_to_export))
71-
del frozen_locals
70+
rst_epilog = "\n".join(map(lambda x: f".. |{x}| replace:: {frozen_locals[x]}", variables_to_export))
71+
del frozen_locals

docs/source/developers.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ To lint the entire project and get suggested changes:
4242

4343
.. code-block:: console
4444
45-
$ pylint sigmf tests
45+
$ ruff check
4646
4747
To autoformat the entire project according to our coding standard:
4848

4949
.. code-block:: console
5050
51-
$ black sigmf tests # autoformat entire project
52-
$ isort sigmf tests # format imports for entire project
51+
$ ruff format
5352
5453
----
5554
Docs

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
sigmf_convert = "sigmf.convert.__main__:main"
4040
[project.optional-dependencies]
4141
test = [
42-
"pylint",
42+
"ruff",
4343
"pytest",
4444
"pytest-cov",
4545
"hypothesis", # next-gen testing framework
@@ -99,6 +99,9 @@ line-length = 120
9999
[tool.isort]
100100
profile = "black"
101101

102+
[tool.ruff]
103+
line-length = 120
104+
102105
[tool.tox]
103106
legacy_tox_ini = '''
104107
[tox]

sigmf/archivereader.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
import zipfile
1212
from pathlib import Path
1313

14-
from . import __version__
1514
from .archive import (
16-
SIGMF_ARCHIVE_EXT,
1715
SIGMF_ARCHIVE_EXTS,
1816
SIGMF_DATASET_EXT,
1917
SIGMF_METADATA_EXT,

sigmf/convert/wav.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import numpy as np
1818

1919
from .. import SigMFFile
20-
from .. import __version__ as toolversion
2120
from .. import fromfile
2221
from ..error import SigMFFileExistsError
2322
from ..sigmffile import get_sigmf_filenames

sigmf/siggen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def _build_metadata(self, samples: np.ndarray) -> dict:
589589
self._description = desc
590590

591591
# build generator info
592-
generator_info = f"SigMFGenerator"
592+
generator_info = "SigMFGenerator"
593593
if self._seed is not None:
594594
generator_info += f"(seed={self._seed:#x})"
595595

sigmf/sigmffile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import numpy as np
1717

18-
from . import __specification__, __version__, hashing, schema, validate
18+
from . import __specification__, hashing, schema, validate
1919
from .archive import (
2020
SIGMF_ARCHIVE_EXT,
2121
SIGMF_COLLECTION_EXT,
@@ -24,7 +24,6 @@
2424
SIGMF_METADATA_EXT,
2525
SigMFArchive,
2626
_detect_compression,
27-
_get_archive_basename,
2827
)
2928
from .error import (
3029
SigMFAccessError,

sigmf/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
import sys
1111
from copy import deepcopy
1212
from datetime import datetime, timezone
13-
from pathlib import Path
1413

1514
import numpy as np
1615

17-
from .error import SigMFConversionError, SigMFError
16+
from .error import SigMFError
1817

1918
SIGMF_DATETIME_ISO8601_FMT = "%Y-%m-%dT%H:%M:%S.%fZ"
2019

tests/test_archive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import jsonschema
1919
import numpy as np
2020

21-
from sigmf import SigMFFile, __specification__, error, fromfile
21+
from sigmf import SigMFFile, error, fromfile
2222
from sigmf.archive import SIGMF_DATASET_EXT, SIGMF_METADATA_EXT
2323
from sigmf.archivereader import SigMFArchiveReader
2424

tests/test_archivereader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import numpy as np
1313

1414
import sigmf
15-
from sigmf import SigMFArchiveReader, SigMFFile, __specification__
15+
from sigmf import SigMFArchiveReader, SigMFFile
1616

1717

1818
class TestArchiveReader(unittest.TestCase):

0 commit comments

Comments
 (0)