diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dfce104..beeae8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: check-toml - id: debug-statements - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.11.0 + rev: v2.12.0 hooks: - id: pretty-format-yaml args: [--preserve-quotes, --autofix, --indent, '2'] @@ -25,7 +25,7 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - repo: https://github.com/psf/black - rev: 23.10.0 + rev: 24.1.1 hooks: - id: black args: [--safe, --quiet, --line-length=100] @@ -34,17 +34,19 @@ repos: hooks: - id: autoflake args: [--in-place, --remove-unused-variable] -- repo: https://github.com/asottile/reorder_python_imports - rev: v3.12.0 +- repo: https://github.com/pycqa/isort + rev: 5.13.2 hooks: - - id: reorder-python-imports + - id: isort + name: isort + args: ["--force-single-line", "--line-length=100", "--profile=black"] - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 args: ['--ignore=E722,W503', --max-line-length=100, '--per-file-ignores=*/__init__.py:F401'] diff --git a/GooseBib/bibtex.py b/GooseBib/bibtex.py index 7f7cd71..7e8065d 100644 --- a/GooseBib/bibtex.py +++ b/GooseBib/bibtex.py @@ -5,6 +5,7 @@ * Check if up-to-date. * Compare. """ + import argparse import difflib import inspect @@ -14,8 +15,8 @@ import sys import textwrap import warnings -from collections import defaultdict from collections import OrderedDict +from collections import defaultdict from functools import singledispatch from typing import Tuple from typing import Union diff --git a/GooseBib/cli/GbibCheckAuthors.py b/GooseBib/cli/GbibCheckAuthors.py index 87703ac..6969a1b 100644 --- a/GooseBib/cli/GbibCheckAuthors.py +++ b/GooseBib/cli/GbibCheckAuthors.py @@ -15,6 +15,7 @@ (c - MIT) T.W.J. de Geus | tom@geus.me | www.geus.me | github.com/tdegeus/GooseBib """ + # ================================================================================================== import os import re diff --git a/GooseBib/cli/GbibCheckKeys.py b/GooseBib/cli/GbibCheckKeys.py index dd7dfb2..d4b8a36 100644 --- a/GooseBib/cli/GbibCheckKeys.py +++ b/GooseBib/cli/GbibCheckKeys.py @@ -14,6 +14,7 @@ (c - MIT) T.W.J. de Geus | tom@geus.me | www.geus.me | github.com/tdegeus/GooseBib """ + # ================================================================================================== import os import re diff --git a/GooseBib/cli/GbibCheckLink.py b/GooseBib/cli/GbibCheckLink.py index 01326f8..95c6746 100644 --- a/GooseBib/cli/GbibCheckLink.py +++ b/GooseBib/cli/GbibCheckLink.py @@ -12,6 +12,7 @@ (c - MIT) T.W.J. de Geus | tom@geus.me | www.geus.me | github.com/tdegeus/GooseBib """ + # ================================================================================================== import os import re diff --git a/GooseBib/cli/GbibList.py b/GooseBib/cli/GbibList.py index 0fcf773..5c3cdb3 100644 --- a/GooseBib/cli/GbibList.py +++ b/GooseBib/cli/GbibList.py @@ -14,6 +14,7 @@ (c - MIT) T.W.J. de Geus | tom@geus.me | www.geus.me | github.com/tdegeus/GooseBib """ + # ================================================================================================== import os import re diff --git a/GooseBib/cli/GbibParse.py b/GooseBib/cli/GbibParse.py index b556320..ed71a40 100644 --- a/GooseBib/cli/GbibParse.py +++ b/GooseBib/cli/GbibParse.py @@ -15,6 +15,7 @@ (c - MIT) T.W.J. de Geus | tom@geus.me | www.geus.me | github.com/tdegeus/GooseBib """ + # ================================================================================================== import os import re diff --git a/GooseBib/cli/GbibSelect.py b/GooseBib/cli/GbibSelect.py index 6bcbaab..a6ad2b0 100644 --- a/GooseBib/cli/GbibSelect.py +++ b/GooseBib/cli/GbibSelect.py @@ -12,6 +12,7 @@ (c - MIT) T.W.J. de Geus | tom@geus.me | www.geus.me | github.com/tdegeus/GooseBib """ + # ================================================================================================== import os import re diff --git a/GooseBib/cli/GbibSelectAlias.py b/GooseBib/cli/GbibSelectAlias.py index 7d06360..8bd4158 100644 --- a/GooseBib/cli/GbibSelectAlias.py +++ b/GooseBib/cli/GbibSelectAlias.py @@ -20,6 +20,7 @@ (c - MIT) T.W.J. de Geus | tom@geus.me | www.geus.me | github.com/tdegeus/GooseBib """ + # ================================================================================================== import json import os diff --git a/GooseBib/journals.py b/GooseBib/journals.py index 36cd132..7be8d4f 100644 --- a/GooseBib/journals.py +++ b/GooseBib/journals.py @@ -17,6 +17,7 @@ Note that the minimal requirement is to store the ``name``, the ``abbreviation``, ``acronym``, and ``variations`` are optional. """ + from __future__ import annotations import csv diff --git a/GooseBib/reformat.py b/GooseBib/reformat.py index 9c456b3..c42cb0f 100644 --- a/GooseBib/reformat.py +++ b/GooseBib/reformat.py @@ -1,6 +1,7 @@ """ Automatic formatting. """ + import re import bibtexparser