diff --git a/.borg.template.toml b/.borg.template.toml new file mode 100644 index 0000000..a8ed9dd --- /dev/null +++ b/.borg.template.toml @@ -0,0 +1,10 @@ +[template] +files = [ + ".gitattributes", + ".gitignore", + "CODE_OF_CONDUCT.md", + "SECURITY.md", + ".github/workflows/pr_reminder.yml", + ".github/workflows/cleanup.yml", + "Makefile", +] diff --git a/.borg.toml b/.borg.toml new file mode 100644 index 0000000..14cd0af --- /dev/null +++ b/.borg.toml @@ -0,0 +1,3 @@ +[source] +url = 'https://raw.githubusercontent.com/techservicesillinois/secdev-template-repository/refs/heads/feature/sync/' # From #22 +# url = 'https://github.com/techservicesillinois/secdev-template-python/blob/main/' diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..819089b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +# Ignore files managed by soar_template in Github PR reviews +.gitattributes linguist-generated +.github/workflows/deploy.yml linguist-generated +.gitignore linguist-generated +CODE_OF_CONDUCT.md linguist-generated +Makefile linguist-generated +SECURITY.md linguist-generated +mypy.ini linguist-generated +pyproject.toml linguist-generated +soar_template linguist-generated +tests/test_python_version.py linguist-generated +requirements*.txt linguist-generated diff --git a/.gitignore b/.gitignore index e69de29..8b3c6f0 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,68 @@ +*.swp +# Coverage output +.coverage +htmlcov +# Common +.bash_* +.histfile +.lesshst +.mysql* +.profile +.vim* +.zsh* +.zcompdump +.gnupg/* +.ssh/* +.subversion/* +.vim/* +.pytest_cache +.python_history +.vscode +.build +.env +cleanup/* +conf +files/* +investigations/* +textfiles/* +pylib/* +*.pyc +*.ini +*.idea +bin/nicinfo +templates/adminify/custom.txt +.build +.env +build/ +dist/ +*.egg-info +*.eggs +wheels +.lint +.requirements.venv +requirements.in +requirements-test.in +.python-version +.venv/ +venv +log.html +output.xml +report.html +jira_export/issues/* +jira_export/issues.html +jira_export/issues.yml +.DS_Store + +# Dump files +*.json + +# Makefile targets +.develop +.deps-test +.static + +# Testing logs +*simulated + +# Setuptools generated files +_version.py diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..18ec0f0 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +VENV_PYTHON:=venv/bin/python +SRCS:=$(shell find src tests -name '*.py') + +all: test + +venv: requirements-test.in requirements.in + rm -rf $@ + python -m venv venv + $(VENV_PYTHON) -m pip install -r $^ +# Install dependencies from pyproject.toml + $(VENV_PYTHON) -m pip install -e . + +lint: venv .lint +.lint: $(SRCS) $(TSCS) + $(VENV_PYTHON) -m flake8 $? + touch $@ + +static: venv .static +.static: $(SRCS) $(TSCS) + echo "Code: $(SRCS)" + echo "Test: $(TSCS)" + $(VENV_PYTHON) -m mypy $^ + touch $@ + +autopep8: + autopep8 --in-place $(SRCS) + +unit: venv + $(VENV_PYTHON) -m pytest + +test: lint static unit + +clean: + rm -rf .lint .static + rm -rf .mypy_cache + -find src -type d -name __pycache__ -exec rm -fr "{}" \; + +force-clean: clean + rm -rf venv diff --git a/README.md b/README.md index 18987b7..47f1c4c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## About This repository is used by Cybersecurity operations teams at the -University of Illinois as a GitHub template. +University of Illinois as a GitHub template *for Python projects*. This resource helps comply with University of Illinois Cybersecurity standards - including [IT-07][it07], [IT08][it08],