From dad4fb893b226e763e0b76af2ce86440c5170801 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Wed, 9 Mar 2022 11:19:38 +0100 Subject: [PATCH] Use pre-commit as lint command --- docs/source/conf.py | 27 ++++++++++++++------------- tox.ini | 10 +++------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 2ab654b..2a4c7b4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,22 +18,23 @@ from importlib.metadata import version # documentation root, use os.path.abspath to make it absolute, like shown here. # Add sources folder -sys.path.insert(0, os.path.abspath('../../')) +sys.path.insert(0, os.path.abspath("../../")) # Setup Django for autodoc -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auditlog_tests.test_settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "auditlog_tests.test_settings") import django + django.setup() # -- Project information ----------------------------------------------------- -project = 'django-auditlog' -author = 'Jan-Jelle Kester and contributors' -copyright = f'2013-{date.today().year}, {author}' +project = "django-auditlog" +author = "Jan-Jelle Kester and contributors" +copyright = f"2013-{date.today().year}, {author}" -release = version('django-auditlog') +release = version("django-auditlog") # for example take major/minor -version = '.'.join(release.split('.')[:2]) +version = ".".join(release.split(".")[:2]) # -- General configuration --------------------------------------------------- @@ -41,27 +42,27 @@ version = '.'.join(release.split('.')[:2]) # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", ] # Master document that contains the root table of contents -master_doc = 'index' +master_doc = "index" # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/tox.ini b/tox.ini index 0075bc9..81bac23 100644 --- a/tox.ini +++ b/tox.ini @@ -37,14 +37,10 @@ changedir = docs/source deps = -rdocs/requirements.txt commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html -[testenv:py38-qa] -basepython = python3.8 -deps = - black - isort +[testenv:lint] +deps = pre-commit commands = - black --check --diff auditlog auditlog_tests setup.py runtests.py - isort --check-only --diff auditlog auditlog_tests setup.py runtests.py + pre-commit run --all-files [gh-actions] python =