bears = WriteGoodLintBear
files = docs/**.rst
-[all.Python]
-bears = BanditBear,
- PEP8Bear,
- PyCommentedCodeBear,
- PyDocStyleBear,
- PyFlakesBear,
- PyImportSortBear
-files = docs_conf/**.py
-known_first_party_imports = lftools
-known_third_party_imports = pytest, six, sphinx_bootstrap_theme
-pydocstyle_ignore = D203, D213, D301
-max_line_length = 88
-
[all.YAML]
bears = YAMLLintBear
files = docs_conf/**.yaml
[*.yaml]
indent_size = 4
-
---
+default_language_version:
+ python: python3
+
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: stable
hooks:
- id: black
- language_version: python3
+
+ - repo: https://gitlab.com/pycqa/flake8
+ rev: 3.8.3
+ hooks:
+ - id: flake8
+ args: ['--max-line-length=88']
+
+ - repo: https://github.com/pycqa/bandit
+ rev: 1.6.2
+ hooks:
+ - id: bandit
+ # Bandit does not need to run on test code
+ exclude: tests/*
+
+ - repo: https://github.com/pycqa/pydocstyle
+ rev: 5.0.2
+ hooks:
+ - id: pydocstyle
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
+"""Configuration for Sphinx."""
import os
import sys
# Sys.path for RTD to resolve docs_conf package
sys.path.insert(0, os.path.abspath(".."))
-from pbr.version import VersionInfo
+from pbr.version import VersionInfo # noqa
-from docs_conf.conf import *
+from docs_conf.conf import * # noqa
version = str(VersionInfo("lfdocs-conf"))
release = str(VersionInfo("lfdocs-conf"))
-"""
-Setup for Docs Configuration
-"""
-from setuptools import setup, find_packages
+"""Setup for Docs Configuration."""
+from setuptools import setup
with open("requirements.txt") as f:
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
-"""
-Docs Conf Tests
-"""
+"""Docs Conf Tests."""
import importlib
import os
import pytest
@pytest.fixture()
def config(tmpdir):
- """
- Create a basic conf.py and conf.cfg file for each test
- """
+ """Create a basic conf.py and conf.cfg file for each test."""
# Create the base 'conf.py'
confpy = tmpdir.join("conf.py")
confpy.write("from docs_conf.conf import *")
def test_config(config):
- """
- Assert some basic assumption about how configurations are pulled in
- """
+ """Assert some basic assumption about how configurations are pulled in."""
assert config.project == "myproject"
assert config.author == "Pythonista"
# assert 'latex_documents' in dir(config)
def test_defaults(config):
- """
- Test the defaults are set and the only thing required is a conf.py
- w/import *
- """
+ """Test the defaults are set and the only thing required is a conf.py w/import *."""
# TODO
assert True
def test_project_override(config):
- """
- Test that setting sphinx.project pulls in the project specific
- defaults
- """
+ """Test that setting sphinx.project pulls in the project specific defaults."""
# TODO
assert True
def test_theme_import(config):
- """
- Test setting sphinx.html_theme_module imports the correct theme
- """
+ """Test setting sphinx.html_theme_module imports the correct theme."""
# TODO
pass