Skip to content
Snippets Groups Projects
Commit 9555e81a authored by Douglas Araujo's avatar Douglas Araujo
Browse files

Merge branch 'add_version_output' into 'main'

6-add-option-to-show-dbformat-version

Closes #6

See merge request !11
parents e84bafc4 a9b2a37c
No related branches found
No related tags found
1 merge request!116-add-option-to-show-dbformat-version
Pipeline #139108 passed
...@@ -3,18 +3,13 @@ repos: ...@@ -3,18 +3,13 @@ repos:
rev: 22.8.0 rev: 22.8.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/PyCQA/flake8.git - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 5.0.4 rev: v0.0.238
hooks: hooks:
- id: flake8 - id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 rev: v4.3.0
hooks: hooks:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- id: check-json - id: check-json
- repo: https://github.com/PyCQA/isort.git
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
...@@ -6,8 +6,12 @@ import re ...@@ -6,8 +6,12 @@ import re
from pathlib import Path from pathlib import Path
from typing import Optional, Sequence, Tuple from typing import Optional, Sequence, Tuple
from pkg_resources import get_distribution
from dbformat import rules from dbformat import rules
__version__ = get_distribution(__name__).version
GUIDELINES = json.loads((Path(__file__).parent / "guidelines.json").read_text()) GUIDELINES = json.loads((Path(__file__).parent / "guidelines.json").read_text())
...@@ -60,6 +64,9 @@ def print_guidelines() -> None: ...@@ -60,6 +64,9 @@ def print_guidelines() -> None:
def main(argv: Optional[Sequence[str]] = None) -> int: def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument(
"-V", "--version", action="version", version=f"{__name__} {__version__}"
)
parser.add_argument("filenames", nargs="*", type=Path, help="filenames to check") parser.add_argument("filenames", nargs="*", type=Path, help="filenames to check")
parser.add_argument( parser.add_argument(
"--print-guidelines", action="store_true", help="print guidelines and exit" "--print-guidelines", action="store_true", help="print guidelines and exit"
......
...@@ -4,3 +4,7 @@ requires = [ ...@@ -4,3 +4,7 @@ requires = [
"wheel" "wheel"
] ]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[tool.ruff]
extend-select = ["D212"]
extend-ignore = ["D105", "D107", "D202", "D418", "E501"]
...@@ -26,8 +26,3 @@ dev = ...@@ -26,8 +26,3 @@ dev =
pytest pytest
pytest-cov pytest-cov
pre-commit pre-commit
[flake8]
ignore = E501, E203, W503
# E501, E203: black
# W503: PEP8
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