diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8eaed9c..89f1365 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/python/black - rev: 18.6b4 + rev: 19.10b0 hooks: - id: black - language_version: python3.6 + language_version: python3.8 diff --git a/.travis.yml b/.travis.yml index 1390545..ef4b68b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: python python: - - "3.6" + - "3.8" sudo: required before_install: diff --git a/aws/ec2/test_ec2_security_group_opens_all_ports_to_all.py b/aws/ec2/test_ec2_security_group_opens_all_ports_to_all.py index d4ed73e..763d201 100644 --- a/aws/ec2/test_ec2_security_group_opens_all_ports_to_all.py +++ b/aws/ec2/test_ec2_security_group_opens_all_ports_to_all.py @@ -1,5 +1,3 @@ - - import pytest from aws.ec2.helpers import ( diff --git a/aws/ec2/test_ec2_security_group_opens_all_ports_to_self.py b/aws/ec2/test_ec2_security_group_opens_all_ports_to_self.py index c82d00a..6127701 100644 --- a/aws/ec2/test_ec2_security_group_opens_all_ports_to_self.py +++ b/aws/ec2/test_ec2_security_group_opens_all_ports_to_self.py @@ -1,5 +1,3 @@ - - import pytest from aws.ec2.helpers import ( diff --git a/aws/iam/meta_test_resources.py b/aws/iam/meta_test_resources.py index 51255eb..28a6347 100644 --- a/aws/iam/meta_test_resources.py +++ b/aws/iam/meta_test_resources.py @@ -1,5 +1,3 @@ - - from dateutil.parser import parse from aws.iam.resources import iam_users, iam_inline_policies diff --git a/aws/iam/test_iam_admin_user_with_access_keys.py b/aws/iam/test_iam_admin_user_with_access_keys.py index b52fa9b..b4d86ca 100644 --- a/aws/iam/test_iam_admin_user_with_access_keys.py +++ b/aws/iam/test_iam_admin_user_with_access_keys.py @@ -18,11 +18,7 @@ def test_iam_admin_user_with_access_key(iam_admin_user): """ assert ( iam_admin_user["CredentialReport"]["access_key_1_active"] != "true" - ), "Access key found for admin user: {}".format( - iam_admin_user["UserName"] - ) + ), "Access key found for admin user: {}".format(iam_admin_user["UserName"]) assert ( iam_admin_user["CredentialReport"]["access_key_2_active"] != "true" - ), "Access key found for admin user: {}".format( - iam_admin_user["UserName"] - ) + ), "Access key found for admin user: {}".format(iam_admin_user["UserName"]) diff --git a/aws/rds/resources.py b/aws/rds/resources.py index d42e961..08d259a 100644 --- a/aws/rds/resources.py +++ b/aws/rds/resources.py @@ -1,5 +1,3 @@ - - from conftest import botocore_client diff --git a/aws/rds/test_rds_db_instance_backup_enabled.py b/aws/rds/test_rds_db_instance_backup_enabled.py index 5d2acea..233e09d 100644 --- a/aws/rds/test_rds_db_instance_backup_enabled.py +++ b/aws/rds/test_rds_db_instance_backup_enabled.py @@ -1,4 +1,3 @@ - import pytest from aws.rds.resources import rds_db_instances_with_tags diff --git a/aws/rds/test_rds_db_instance_is_multiaz.py b/aws/rds/test_rds_db_instance_is_multiaz.py index d4c94f4..d31e028 100644 --- a/aws/rds/test_rds_db_instance_is_multiaz.py +++ b/aws/rds/test_rds_db_instance_is_multiaz.py @@ -1,4 +1,3 @@ - import pytest from aws.rds.resources import rds_db_instances_with_tags diff --git a/aws/rds/test_rds_db_instance_is_postgres_with_invalid_certificate.py b/aws/rds/test_rds_db_instance_is_postgres_with_invalid_certificate.py index 24bbbf6..9473924 100644 --- a/aws/rds/test_rds_db_instance_is_postgres_with_invalid_certificate.py +++ b/aws/rds/test_rds_db_instance_is_postgres_with_invalid_certificate.py @@ -1,5 +1,3 @@ - - import datetime from botocore.utils import parse_timestamp diff --git a/aws/rds/test_rds_db_instance_minor_version_updates_enabled.py b/aws/rds/test_rds_db_instance_minor_version_updates_enabled.py index 7d8c674..c8879f8 100644 --- a/aws/rds/test_rds_db_instance_minor_version_updates_enabled.py +++ b/aws/rds/test_rds_db_instance_minor_version_updates_enabled.py @@ -1,4 +1,3 @@ - import pytest from aws.rds.resources import rds_db_instances_with_tags diff --git a/aws/redshift/resources.py b/aws/redshift/resources.py index f7545ac..831c5ed 100644 --- a/aws/redshift/resources.py +++ b/aws/redshift/resources.py @@ -1,5 +1,3 @@ - - from conftest import botocore_client diff --git a/aws/redshift/test_redshift_security_group_does_not_allow_all_ips_access.py b/aws/redshift/test_redshift_security_group_does_not_allow_all_ips_access.py index 7645854..70db247 100644 --- a/aws/redshift/test_redshift_security_group_does_not_allow_all_ips_access.py +++ b/aws/redshift/test_redshift_security_group_does_not_allow_all_ips_access.py @@ -1,5 +1,3 @@ - - import pytest from aws.redshift.resources import redshift_cluster_security_groups diff --git a/aws/s3/resources.py b/aws/s3/resources.py index 57d5f2a..cbae993 100644 --- a/aws/s3/resources.py +++ b/aws/s3/resources.py @@ -1,5 +1,3 @@ - - from conftest import botocore_client diff --git a/aws/s3/test_s3_bucket_cors_disabled.py b/aws/s3/test_s3_bucket_cors_disabled.py index 8e46ffd..9e8fc11 100644 --- a/aws/s3/test_s3_bucket_cors_disabled.py +++ b/aws/s3/test_s3_bucket_cors_disabled.py @@ -1,4 +1,3 @@ - import pytest from aws.s3.resources import s3_buckets, s3_buckets_cors_rules diff --git a/aws/s3/test_s3_bucket_does_not_grant_all_principals_all_actions.py b/aws/s3/test_s3_bucket_does_not_grant_all_principals_all_actions.py index fa3c5ca..4514b54 100644 --- a/aws/s3/test_s3_bucket_does_not_grant_all_principals_all_actions.py +++ b/aws/s3/test_s3_bucket_does_not_grant_all_principals_all_actions.py @@ -1,4 +1,3 @@ - import json import pytest diff --git a/aws/s3/test_s3_bucket_logging_enabled.py b/aws/s3/test_s3_bucket_logging_enabled.py index 2c3c2c6..2fa9196 100644 --- a/aws/s3/test_s3_bucket_logging_enabled.py +++ b/aws/s3/test_s3_bucket_logging_enabled.py @@ -1,4 +1,3 @@ - import pytest from aws.s3.resources import s3_buckets, s3_buckets_logging diff --git a/aws/s3/test_s3_bucket_no_world_acl.py b/aws/s3/test_s3_bucket_no_world_acl.py index 906dd6d..c2c79d0 100644 --- a/aws/s3/test_s3_bucket_no_world_acl.py +++ b/aws/s3/test_s3_bucket_no_world_acl.py @@ -1,4 +1,3 @@ - import pytest from aws.s3.resources import s3_buckets, s3_buckets_acls diff --git a/aws/s3/test_s3_bucket_versioning_enabled.py b/aws/s3/test_s3_bucket_versioning_enabled.py index 6e078c4..13084a1 100644 --- a/aws/s3/test_s3_bucket_versioning_enabled.py +++ b/aws/s3/test_s3_bucket_versioning_enabled.py @@ -1,4 +1,3 @@ - import pytest from aws.s3.resources import s3_buckets, s3_buckets_versioning diff --git a/aws/s3/test_s3_bucket_versioning_mfa_delete_enabled.py b/aws/s3/test_s3_bucket_versioning_mfa_delete_enabled.py index 0f6ea98..fcf2deb 100644 --- a/aws/s3/test_s3_bucket_versioning_mfa_delete_enabled.py +++ b/aws/s3/test_s3_bucket_versioning_mfa_delete_enabled.py @@ -1,4 +1,3 @@ - import pytest from aws.s3.resources import s3_buckets, s3_buckets_versioning diff --git a/aws/s3/test_s3_bucket_web_hosting_disabled.py b/aws/s3/test_s3_bucket_web_hosting_disabled.py index 96878df..00dabda 100644 --- a/aws/s3/test_s3_bucket_web_hosting_disabled.py +++ b/aws/s3/test_s3_bucket_web_hosting_disabled.py @@ -1,4 +1,3 @@ - import pytest from aws.s3.resources import s3_buckets, s3_buckets_website diff --git a/cache.py b/cache.py index c80cac3..3feacb5 100644 --- a/cache.py +++ b/cache.py @@ -1,4 +1,3 @@ - """ Patch for pytest cache to serialize datetime.datetime """ diff --git a/exemptions.py b/exemptions.py index 004d486..8390155 100644 --- a/exemptions.py +++ b/exemptions.py @@ -1,5 +1,3 @@ - - from collections import defaultdict from datetime import date import re diff --git a/gcp/iam/test_only_allowed_org_accounts.py b/gcp/iam/test_only_allowed_org_accounts.py index a1404b6..979e9ff 100644 --- a/gcp/iam/test_only_allowed_org_accounts.py +++ b/gcp/iam/test_only_allowed_org_accounts.py @@ -28,6 +28,4 @@ def test_only_allowed_org_accounts(iam_binding, allowed_org_domains): if not member.startswith("serviceAccount"): assert ( member.split("@")[-1] in allowed_org_domains - ), "{} was found and is not in the allowed_org_domains".format( - member - ) + ), "{} was found and is not in the allowed_org_domains".format(member) diff --git a/gcp/sql/test_sql_instance_private_ip_required.py b/gcp/sql/test_sql_instance_private_ip_required.py index 2e03f70..ba8f088 100644 --- a/gcp/sql/test_sql_instance_private_ip_required.py +++ b/gcp/sql/test_sql_instance_private_ip_required.py @@ -22,6 +22,4 @@ def test_sql_instance_private_ip_required(sql_instance): assert ( sql_instance.get("settings").get("ipConfiguration").get("ipv4Enabled", None) == False - ), "CloudSQL Instance {0[name]} has a public IPv4 enabled.".format( - sql_instance - ) + ), "CloudSQL Instance {0[name]} has a public IPv4 enabled.".format(sql_instance) diff --git a/heroku/resources.py b/heroku/resources.py index c82ed47..e66a54f 100644 --- a/heroku/resources.py +++ b/heroku/resources.py @@ -1,4 +1,3 @@ - from conftest import heroku_client diff --git a/meta_test_cache.py b/meta_test_cache.py index d5cef64..6e5e819 100644 --- a/meta_test_cache.py +++ b/meta_test_cache.py @@ -1,5 +1,3 @@ - - from datetime import datetime from dateutil.parser import parse diff --git a/pagerduty/helpers.py b/pagerduty/helpers.py index 4dc69f9..f18ce39 100644 --- a/pagerduty/helpers.py +++ b/pagerduty/helpers.py @@ -1,5 +1,3 @@ - - from pagerduty.resources import alternate_usernames diff --git a/pagerduty/resources.py b/pagerduty/resources.py index dc1efa8..93f1b73 100644 --- a/pagerduty/resources.py +++ b/pagerduty/resources.py @@ -1,5 +1,3 @@ - - import functools import json from pathlib import Path diff --git a/pagerduty/test_bastion_users_have_pd_remote_monitoring_configured.py b/pagerduty/test_bastion_users_have_pd_remote_monitoring_configured.py index 21b8432..acf9adc 100644 --- a/pagerduty/test_bastion_users_have_pd_remote_monitoring_configured.py +++ b/pagerduty/test_bastion_users_have_pd_remote_monitoring_configured.py @@ -1,5 +1,3 @@ - - import pytest from pagerduty.helpers import alternate_names_for_user diff --git a/pagerduty/test_iam_users_have_pd_remote_monitoring_configured.py b/pagerduty/test_iam_users_have_pd_remote_monitoring_configured.py index ba20c53..90a78a0 100644 --- a/pagerduty/test_iam_users_have_pd_remote_monitoring_configured.py +++ b/pagerduty/test_iam_users_have_pd_remote_monitoring_configured.py @@ -1,10 +1,8 @@ - - import pytest from aws.iam.resources import get_all_users_that_can_access_aws_account from pagerduty.helpers import alternate_names_for_user from pagerduty.resources import ( - users_with_remote_access_escalation_policy_and_extension_configured + users_with_remote_access_escalation_policy_and_extension_configured, ) diff --git a/regressions.py b/regressions.py index 9207787..f2d4674 100644 --- a/regressions.py +++ b/regressions.py @@ -1,4 +1,3 @@ - from collections import defaultdict import re import warnings diff --git a/severity.py b/severity.py index e8bac2d..b2faf69 100644 --- a/severity.py +++ b/severity.py @@ -1,5 +1,3 @@ - - from collections import defaultdict import warnings