7 Commits

Author SHA1 Message Date
de0bb21fb3 Apply isort (forcing single lines, not sorting by type) via ruff
$ ruff check --fix --select=I \
  --config=lint.isort.force-single-line=true \
  --config=lint.isort.order-by-type=false \
  BioSQL/ Bio/ Tests/ Scripts/ Doc/ setup.py

Using ruff version 0.4.10
2024-06-26 15:31:39 +09:00
0938871295 black v23.9.1
Had to tweak four conflicts with D202
2023-10-05 08:47:54 +01:00
1b9e569a7f Using tool unify to convert Tests/ to use double quotes
Using https://github.com/myint/unify for this:

$ unify --quote \" --in-place Tests/*.py Tests/*/*.py
2019-08-02 14:10:22 +01:00
e7199398bf flake8 D400: Add missing dot to Tests/ docstrings
Done with the following script, reverting false positives in
several files triggered by missing docstrings which the script
does not consider:

import sys

def fix(lines):
    answer = []
    post_def = False
    for line in lines:
        if line.lstrip().startswith(("def ", "class ")):
            # print(line.rstrip())
            post_def = True
        if post_def and line.lstrip().startswith('"""'):
            post_def = False
            # Looks like line one of a docstring
            if line.rstrip().endswith('"""'):
                # a one-liner
                if line.rstrip().endswith('."""'):
                    # good
                    pass
                elif line.rstrip().endswith(('?"""', '!"""')):
                    # ugly
                    pass
                else:
                    print(line.rstrip())
                    line = line.rstrip()[:-3] + '."""\n'
            else:
                # multi-liner
                if line.rstrip().endswith('.'):
                    # good
                    pass
                elif line.rstrip().endswith(('?', '!')):
                    # ugly
                    pass
                else:
                    print(line.rstrip())
                    line = line.rstrip() + ".\n"
        answer.append(line)
    return answer

for f in sys.argv[1:]:
    print(f)
    with open(f) as handle:
        old = list(handle)
    new = fix(old)
    with open(f, "w") as handle:
        for line in new:
            handle.write(line)
print("Done")
2019-04-22 09:00:41 +01:00
c8b727a05a Docstring tweaks for Tests/ 2017-05-04 17:23:20 +01:00
b67cebf60e Fix common PEP8 violation in unittest verbosity argument 2014-11-11 14:38:37 +09:00
bow
aa7dcf6b21 Refactor SearchIO indexing tests 2012-12-09 19:28:45 +01:00