Skip to content

Commit

Permalink
add new pre-commit hooks, licencse, MD lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanprytula committed Dec 13, 2024
1 parent 32f8f6d commit dba47bf
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 6 deletions.
12 changes: 11 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
max_line_length = 120
max_line_length = 119
indent_size = 2

[*.md]
max_line_length = 120

[*.{html,css,scss,json,yaml,yml,xml}]
indent_size = 2

[*.md]
indent_size = 2

# Makefile always use tabs for indentation
[Makefile]
indent_style = tab
11 changes: 11 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# include these values in GitHub repository secrets
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_DEFAULT_REGION=
export AWS_ACCOUNT_ID=
export STACK_NAME=
# include these values in GitHub environment secrets
export DOMAIN_NAME=app.example.com
export HOSTNAME=app.example.com
export KEY_PAIR_NAME=my-key-pair
export ZONE_NAME=example.com
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ wheels/
# Virtual environments
.venv

# Environment variables
.env

# Documentation build by MkDocs
site/

# Tools caches
.ruff_cache/
5 changes: 5 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"default": true,
"MD041": false,
"MD013": false
}
42 changes: 37 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

exclude: "^site/|/migrations/"
default_stages: [pre-commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-builtin-literals
- id: check-added-large-files

# Security
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: detect-private-key

# Cross platform
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format

# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
autoupdate_schedule: weekly
skip: []
submodules: false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Ivan Prytula

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
help: ## Show this help (color=yes)
@grep --extended-regexp '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

0 comments on commit dba47bf

Please sign in to comment.