Skip to content

Commit

Permalink
Dev (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsaygelle authored May 8, 2024
1 parent 4decea2 commit 828d6a5
Show file tree
Hide file tree
Showing 9 changed files with 354 additions and 2 deletions.
Empty file added .codespelldictionary
Empty file.
Empty file added .codespellignore
Empty file.
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"customizations": {
"vscode": {
"extensions": [
"GitHub.vscode-pull-request-github",
"VisualStudioExptTeam.intellicode-api-usage-examples",
"VisualStudioExptTeam.vscodeintellicode",
"eamodio.gitlens",
"github.vscode-github-actions",
"hashicorp.terraform",
"ms-azuretools.vscode-docker",
"ms-vscode.makefile-tools",
"ms-vscode-remote.remote-containers",
"redhat.vscode-yaml"
],
"settings": {
"[makefile]": {
"editor.insertSpaces": true,
"editor.tabSize": 4
},
"[terraform]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"[velocity]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"editor.formatOnSaveMode": "file"
}
}
},
"features": {
"ghcr.io/devcontainers/features/aws-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/terraform:1": {
"version": "latest"
}
},
"image": "mcr.microsoft.com/devcontainers/universal:latest"
}
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
reviewers:
- "lindsaygelle"
schedule:
day: "monday"
interval: "weekly"
time: "09:00"
timezone: "Australia/Sydney"

- package-ecosystem: "github-actions"
directory: "/"
reviewers:
- "lindsaygelle"
schedule:
day: "monday"
interval: "weekly"
time: "09:00"
timezone: "Australia/Sydney"

- package-ecosystem: "pip"
directory: "/"
reviewers:
- "lindsaygelle"
schedule:
interval: "weekly"
time: "09:00"
timezone: "Australia/Sydney"
168 changes: 166 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,167 @@
# Python

# 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/
share/python-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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# 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/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Terraform
# Local .terraform directories
**/.terraform/*

Expand All @@ -10,8 +174,8 @@ crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json
Expand Down
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.3.0"
hooks:
- id: "check-merge-conflict"
- id: "check-json"
files: |
(?x)^.*(\.json)$
- id: "check-yaml"
files: |
(?x)^.*(\.yaml|\.yml)$
- id: "detect-private-key"
- id: "end-of-file-fixer"
exclude: ^(\.idea/workspace\.xml|.*\.svg)$
- id: "debug-statements"
- id: "mixed-line-ending"
exclude: ^(\.idea/workspace\.xml|.*\.svg)$
- id: "no-commit-to-branch"
args: [--branch, main]
- id: "trailing-whitespace"
exclude: ^(\.idea/workspace\.xml|.*\.svg)$
- repo: "https://github.com/codespell-project/codespell"
rev: v2.1.0
hooks:
- id: codespell
args: [--dictionary=.codespelldictionary, --ignore-words=.codespellignore]
- repo: "local"
hooks:
- id: terraform
entry: terraform fmt -recursive
language: system
name: terraform
types: [terraform]
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"settings": {
"[makefile]": {
"editor.insertSpaces": true,
"editor.tabSize": 4
},
"[terraform]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"[velocity]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"editor.formatOnSaveMode": "file"
}
}
57 changes: 57 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
ifndef VERBOSE
MAKEFLAGS += --no-print-directory
endif
SHELL := /bin/bash
.DEFAULT_GOAL := help

help:
@ echo "Use one of the following targets:"
@ tail -n +8 Makefile |\
egrep "^[a-z]+[\ :]" |\
tr -d : |\
tr " " "/" |\
sed "s/^/ - /g"
@ echo "Read the Makefile for further details"

clean:
@ echo "Cleaning old files..."
@ rm -rf **/.pytest_cache
@ rm -rf .tox
@ rm -rf dist
@ rm -rf build
@ rm -rf **/__pycache__
@ rm -rf *.egg-info
@ rm -rf .coverage*
@ rm -rf **/*.pyc
@ rm -rf env
@ rm -rf local
@ echo "All done!"

env environment:
@ echo "Activating Python environment"
@ bash --rcfile "./env/bin/activate"
@ echo "Done!"

fmt format:
@ terraform fmt \
-recursive

requirements:
@ if [ -z "${VIRTUAL_ENV}" ]; then \
echo "Not inside a virtualenv."; \
exit 1; \
fi
@ echo "Upgrading pip..."
@ pip install --upgrade pip
@ echo "Updating pip packages:"
@ pip install -r "./requirements.txt"
@ echo "Self installing this package in edit mode:"
@ pip install -e .
@ echo "You are ready to go ;-)"

venv virtualenv:
@ echo "Creating a new virtualenv..."
@ rm -rf env || true
@ python -m venv env
@ echo "Done, now you need to activate it. Run:"
@ echo "source env/bin/activate" or "make env"
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cfgv==3.4.0
distlib==0.3.8
filelock==3.14.0
identify==2.5.36
nodeenv==1.8.0
platformdirs==4.2.1
pre-commit==3.7.0
PyYAML==6.0.1
virtualenv==20.26.1

0 comments on commit 828d6a5

Please sign in to comment.