chore: replace flake8 config file and add autoformatting

This commit is contained in:
Robert Kaussow 2021-06-07 22:14:44 +02:00
parent cb349a300b
commit 463fa12a63
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 18 additions and 9 deletions

View File

@ -1,5 +0,0 @@
[flake8]
ignore = D101, D102, D103, D105, D107, E402, W503
max-line-length = 99
inline-quotes = double
exclude = .git,.tox,__pycache__,build,dist,tests,*.pyc,*.egg-info,.cache,.eggs,env*

View File

@ -3,16 +3,18 @@ import os
import testinfra.utils.ansible_runner import testinfra.utils.ansible_runner
import warnings import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.filterwarnings("ignore", category=DeprecationWarning)
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_pam_config(host): def test_pam_config(host):
auth = host.file("/etc/pam.d/system-auth") auth = host.file("/etc/pam.d/system-auth")
assert auth.contains("auth sufficient pam_unix.so nullok try_first_pass")
assert auth.contains( assert auth.contains(
"auth sufficient pam_unix.so nullok try_first_pass") "password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok"
assert auth.contains( )
"password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok")

12
setup.cfg Normal file
View File

@ -0,0 +1,12 @@
[flake8]
ignore = D100, D101, D102, D103, D105, D107, E402, W503
max-line-length = 99
inline-quotes = double
exclude = .git,.tox,__pycache__,build,dist,tests,*.pyc,*.egg-info,.cache,.eggs,env*
[yapf]
based_on_style = google
column_limit = 99
dedent_closing_brackets = true
coalesce_brackets = true
split_before_logical_operator = true