-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Iaa6fdc75c054aebe39d7c690a1e56d2b59366351
- Loading branch information
0 parents
commit 6304f48
Showing
72 changed files
with
4,426 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
exclude = | ||
doc, | ||
.tox, | ||
.git, | ||
.yml, | ||
Pipfile.*, | ||
ansible/*, | ||
docs/*, | ||
.cache/* | ||
|
||
fcfn_exclude_functions = | ||
re, | ||
split, | ||
replace, | ||
os, | ||
parser, | ||
int, | ||
str, | ||
urllib, | ||
shutil, | ||
LOGGER, | ||
list, | ||
getattr, | ||
compile, | ||
get_plugin, | ||
ElementTree, | ||
xml_doc, | ||
findall, | ||
record_testsuite_property, | ||
get, | ||
time, | ||
tmpdir_factory, | ||
sh, | ||
next, | ||
json, | ||
yaml, | ||
subprocess, | ||
sorted, | ||
jinja2, | ||
xmltodict, | ||
netaddr, | ||
dict, | ||
round, | ||
request, | ||
range, | ||
min, | ||
len, | ||
sub, | ||
extend, | ||
setdefault, | ||
float, | ||
sum, | ||
append, | ||
join, | ||
deepcopy, | ||
print, | ||
logging, | ||
add_option, | ||
pytest, | ||
update, | ||
expect, | ||
sendline, | ||
write, | ||
open, | ||
insert, | ||
send, | ||
namedtuple, | ||
strip, | ||
parametrize, | ||
pop, | ||
remove, | ||
console_eof_sampler, | ||
check_output, | ||
sleep, | ||
datetime, | ||
intersection | ||
|
||
[flake8:local-plugins] | ||
extension = | ||
FCFN = flake8_plugins.FunctionCallForceNames:FunctionCallForceNames | ||
paths = | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Temporary files | ||
_out | ||
|
||
# Created by .ignore support plugin (hsz.mobi) | ||
### Python template | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
pytest-tests.log | ||
tests-collected-info | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# Sphinx docs | ||
docs/source/rst | ||
|
||
# IntelliJ project folder | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[settings] | ||
use_parentheses=true | ||
multi_line_output=3 | ||
include_trailing_comma=true | ||
line_length=88 | ||
lines_after_imports=2 | ||
known_first_party=six |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
default_language_version: | ||
python: python3 | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v4.3.21 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/ambv/black | ||
rev: 19.10b0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.1.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 3.8.3 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/var/run/docker.sock:/var/run/docker.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
docker | ||
gcc | ||
git | ||
make | ||
openshift-clients | ||
python3-devel | ||
python3-pip | ||
python3-setuptools | ||
wget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
http://download.eng.bos.redhat.com/rcm-guest/puddles/RHAOS/AtomicOpenShift/4.2/latest/x86_64/os/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash -e | ||
|
||
python=python3 | ||
|
||
main() { | ||
TARGET="$0" | ||
TARGET="${TARGET#./}" | ||
TARGET="${TARGET%.*}" | ||
TARGET="${TARGET#*.}" | ||
echo "TARGET=$TARGET" | ||
|
||
export PATH="$PATH:/usr/local/bin" | ||
|
||
case "${TARGET}" in | ||
"check" ) | ||
check | ||
;; | ||
* ) | ||
echo "Unknown target" | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
check() { | ||
$python -m pip install tox | ||
make check | ||
} | ||
|
||
|
||
[[ "${BASH_SOURCE[0]}" == "$0" ]] && main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Function Call Force Names (a flake8 plugin) | ||
FunctionCallForceNames (FCFN001) is a flake8 plugin, which role is enforcing | ||
that functions are called with arg=value, rather than value only. | ||
|
||
### Example: | ||
Valid call: | ||
```python | ||
foo(num=1, txt="txt") | ||
``` | ||
|
||
Invalid call: | ||
```python | ||
foo(1, txt="txt") | ||
``` | ||
|
||
In case of an invalid call - the plugin will trigger a flake8 failure: | ||
```bash | ||
$ pre-commit run --all-files | ||
... | ||
flake8...................................................................Failed | ||
... | ||
<path-to-file>:<line#>:<function-call-column#>: FCFN001: [<calling-function-name>] function should be called with keywords arguments. value: <value> (line:<line#> column:<missing-name-column#>) | ||
``` | ||
(pre-commit includes invokation of flake8). | ||
|
||
For example: | ||
```bash | ||
$ pre-commit run --all-files | ||
... | ||
flake8...................................................................Failed | ||
... | ||
tests/network/general/test_bridge_marker.py:135:5: FCFN001: [test_bridge_marker_no_device] function should be called with keywords arguments. value: pod (line:135 column:45) | ||
``` | ||
|
||
### Note: | ||
1. It's no necessary to explictly call pre-commit to enforce FCFN001, | ||
as flake8 is invoked automatically when running "git commit". | ||
2. To test flake8 validity of a specific file, you can run | ||
```bash | ||
$ pre-commit run --file <path-to-file> | ||
``` | ||
For example: | ||
```bash | ||
$ pre-commit run --file tests/network/general/test_bridge_marker.py | ||
``` |
Oops, something went wrong.