Skip to content

Commit

Permalink
Merge pull request #28 from networktocode/general-tidyup
Browse files Browse the repository at this point in the history
Fix linting, bandit, format issues
  • Loading branch information
rickdonato authored Jul 29, 2020
2 parents ad7c056 + 53ba8f5 commit c16af53
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ flake8: ## Python linting via Flake8.
find . -name venv -prune -o -name '*.py' -exec flake8 {} +

yamllint: ## YAML linting via Yamllint.
find . \( -name *.yaml -o -name *.yml \) | xargs yamllint
find \( -name *.yaml -o -name *.yml \) | xargs yamllint -d "{ignore: docker-compose.yml}"

black: ## Format checking via Black.
black --check . --exclude venv/
Expand All @@ -30,6 +30,6 @@ pytest: ## Unit tests via Pytest.
bandit: ## Security checks via Bandit.
bandit --exclude ./venv --recursive --config .bandit.yml .

tests: pylint yamllint black pytest bandit pytest ## Format, lint, security and unit tests
tests: flake8 yamllint black pytest bandit ## Format, lint, security and unit tests

# :%s/^[ ]\+/\t/g - automatically replace all tabs with spaces
1 change: 0 additions & 1 deletion acl_auditor/auditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import argparse
import logging
import os
import sys

from pybatfish.client.commands import bf_session
Expand Down
2 changes: 1 addition & 1 deletion acl_auditor/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def write_file(filename, data):

def read_yaml(filename):
with open(filename) as file:
return yaml.load(file, Loader=yaml.FullLoader)
return yaml.safe_load(file)


def return_rc(results):
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.5'
services:
ntc-soteria:
container_name: acl_auditor
container_name: ntc-soteria
build:
context: .
dockerfile: Dockerfile
Expand All @@ -12,8 +12,8 @@ services:
volumes:
- ./data:/source/data
batfish:
container_name: batfish
image: batfish/batfish:latest
ports:
- 9997:9997
- 9996:9996
container_name: batfish
image: batfish/batfish:latest
ports:
- 9997:9997
- 9996:9996
110 changes: 108 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ black = "^19.10b0"
jinja2 = "^2.11.2"
rope = "^0.17.0"
tabulate = "^0.8.7"
yamllint = "^1.24.2"
bandit = "^1.6.2"

[tool.poetry.dev-dependencies]

Expand Down

0 comments on commit c16af53

Please sign in to comment.