Merge "Adding pre-commit"
Zuul authored 2 years ago
Gerrit Code Review committed 2 years ago
|
0 |
# We from the Oslo project decided to pin repos based on the
|
|
1 |
# commit hash instead of the version tag to prevend arbitrary
|
|
2 |
# code from running in developer's machines. To update to a
|
|
3 |
# newer version, run `pre-commit autoupdate` and then replace
|
|
4 |
# the newer versions with their commit hash.
|
|
5 |
|
|
6 |
default_language_version:
|
|
7 |
python: python3
|
|
8 |
|
|
9 |
repos:
|
|
10 |
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
11 |
rev: ebc15addedad713c86ef18ae9632c88e187dd0af # v3.1.0
|
|
12 |
hooks:
|
|
13 |
- id: trailing-whitespace
|
|
14 |
# Replaces or checks mixed line ending
|
|
15 |
- id: mixed-line-ending
|
|
16 |
args: ['--fix', 'lf']
|
|
17 |
exclude: '.*\.(svg)$'
|
|
18 |
# Forbid files which have a UTF-8 byte-order marker
|
|
19 |
- id: check-byte-order-marker
|
|
20 |
# Checks that non-binary executables have a proper shebang
|
|
21 |
- id: check-executables-have-shebangs
|
|
22 |
# Check for files that contain merge conflict strings.
|
|
23 |
- id: check-merge-conflict
|
|
24 |
# Check for debugger imports and py37+ breakpoint()
|
|
25 |
# calls in python source
|
|
26 |
- id: debug-statements
|
|
27 |
- id: check-yaml
|
|
28 |
files: .*\.(yaml|yml)$
|
|
29 |
- repo: https://gitlab.com/pycqa/flake8
|
|
30 |
rev: 181bb46098dddf7e2d45319ea654b4b4d58c2840 # 3.8.3
|
|
31 |
hooks:
|
|
32 |
- id: flake8
|
|
33 |
additional_dependencies:
|
|
34 |
- hacking>=3.0.1,<3.1.0
|
|
0 |
# Copyright (C) 2020 Red Hat, Inc.
|
|
1 |
#
|
0 | 2 |
# Licensed under the Apache License, Version 2.0 (the "License");
|
1 | 3 |
# you may not use this file except in compliance with the License.
|
2 | 4 |
# You may obtain a copy of the License at
|
|
20 | 22 |
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
21 | 23 |
extensions = [
|
22 | 24 |
'sphinx.ext.autodoc',
|
23 | |
#'sphinx.ext.intersphinx',
|
24 | 25 |
'openstackdocstheme',
|
25 | 26 |
'sphinxcontrib.rsvgconverter',
|
26 | 27 |
]
|
|
80 | 81 |
|
81 | 82 |
latex_use_xindy = False
|
82 | 83 |
|
83 | |
# Example configuration for intersphinx: refer to the Python standard library.
|
84 | |
#intersphinx_mapping = {'https://docs.python.org/3/': None}
|
85 | |
|
86 | 84 |
# -- Options for openstackdocstheme -------------------------------------------
|
87 | 85 |
openstackdocs_repo_name = 'openstack/castellan'
|
88 | 86 |
openstackdocs_pdf_link = True
|
16 | 16 |
testtools>=2.2.0 # MIT
|
17 | 17 |
bandit>=1.6.0,<1.7.0 # Apache-2.0
|
18 | 18 |
pifpaf>=0.10.0 # Apache-2.0
|
|
19 |
|
|
20 |
pre-commit>=2.6.0 # MIT
|
17 | 17 |
|
18 | 18 |
[testenv:pep8]
|
19 | 19 |
commands =
|
20 | |
flake8
|
|
20 |
pre-commit run -a
|
21 | 21 |
bandit -r castellan -x tests -s B105,B106,B107,B607
|
22 | 22 |
|
23 | 23 |
[testenv:bandit]
|