Skip to content
Snippets Groups Projects
Commit b1cf7569 authored by Yannick DAYER's avatar Yannick DAYER
Browse files

[qa] Auto-update precommit and apply on all files.

parent 872a2eb0
No related branches found
No related tags found
1 merge request!46Auto-update pre-commit
Pipeline #69307 failed
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
repos: repos:
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 22.10.0 rev: 22.12.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/pycqa/docformatter - repo: https://github.com/pycqa/docformatter
rev: v1.5.0 rev: v1.6.0.rc1
hooks: hooks:
- id: docformatter - id: docformatter
- repo: https://github.com/pycqa/isort - repo: https://github.com/pycqa/isort
rev: 5.10.1 rev: 5.12.0
hooks: hooks:
- id: isort - id: isort
- repo: https://github.com/pycqa/flake8 - repo: https://github.com/pycqa/flake8
rev: 3.9.2 rev: 6.0.0
hooks: hooks:
- id: flake8 - id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982 rev: v0.991
hooks: hooks:
- id: mypy - id: mypy
args: [ args: [
...@@ -28,12 +28,12 @@ repos: ...@@ -28,12 +28,12 @@ repos:
--ignore-missing-imports, --ignore-missing-imports,
] ]
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.1.0 rev: v3.3.1
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py38-plus] args: [--py38-plus]
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 rev: v4.4.0
hooks: hooks:
- id: check-ast - id: check-ast
- id: check-added-large-files - id: check-added-large-files
......
...@@ -67,7 +67,6 @@ def open_file(filename) -> np.ndarray: ...@@ -67,7 +67,6 @@ def open_file(filename) -> np.ndarray:
``filename`` : str ``filename`` : str
The name of the file to open. The name of the file to open.
""" """
def check_gray(img): def check_gray(img):
# Checking for gray scaled images # Checking for gray scaled images
if ( if (
...@@ -131,7 +130,6 @@ def write_file(filename, data, format="pillow") -> None: ...@@ -131,7 +130,6 @@ def write_file(filename, data, format="pillow") -> None:
``format`` : str ``format`` : str
The format to use to read the file. By default imageio selects the appropriate for you based on the filename and its contents The format to use to read the file. By default imageio selects the appropriate for you based on the filename and its contents
""" """
extension = os.path.splitext(filename)[1] # get the extension extension = os.path.splitext(filename)[1] # get the extension
if extension in hdf5_extensions: if extension in hdf5_extensions:
...@@ -171,7 +169,6 @@ def load(inputs) -> np.ndarray: ...@@ -171,7 +169,6 @@ def load(inputs) -> np.ndarray:
``data`` : :py:class:`numpy.ndarray` ``data`` : :py:class:`numpy.ndarray`
The data loaded from the given ``inputs``. The data loaded from the given ``inputs``.
""" """
from collections.abc import Iterable from collections.abc import Iterable
import numpy import numpy
...@@ -261,7 +258,6 @@ def _generate_features(reader, paths, same_size=False): ...@@ -261,7 +258,6 @@ def _generate_features(reader, paths, same_size=False):
features and the shape of the first feature. The rest of objects are features and the shape of the first feature. The rest of objects are
the actual values in features. The features are returned in C order. the actual values in features. The features are returned in C order.
""" """
shape_determined = False shape_determined = False
for i, path in enumerate(paths): for i, path in enumerate(paths):
......
...@@ -41,7 +41,6 @@ def datafile(f, module=None, path="data"): ...@@ -41,7 +41,6 @@ def datafile(f, module=None, path="data"):
``filename`` : str ``filename`` : str
The full path of the file The full path of the file
""" """
resource = __name__ if module is None else module resource = __name__ if module is None else module
final_path = f if path is None else os.path.join(path, f) final_path = f if path is None else os.path.join(path, f)
import pkg_resources import pkg_resources
...@@ -102,7 +101,6 @@ def extension_available(extension): ...@@ -102,7 +101,6 @@ def extension_available(extension):
def my_test(): def my_test():
... ...
""" """
def test_wrapper(test): def test_wrapper(test):
@functools.wraps(test) @functools.wraps(test)
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
......
...@@ -15,7 +15,6 @@ from bob.io.base import load, save ...@@ -15,7 +15,6 @@ from bob.io.base import load, save
def read_write_check(data, numpy_assert=True): def read_write_check(data, numpy_assert=True):
"""Testing loading and save different file types.""" """Testing loading and save different file types."""
with tempfile.NamedTemporaryFile(prefix="bobtest_", suffix=".hdf5") as f: with tempfile.NamedTemporaryFile(prefix="bobtest_", suffix=".hdf5") as f:
save(data, f.name) save(data, f.name)
data2 = load(f.name) data2 = load(f.name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment