Skip to content

Commit

Permalink
Merge pull request #23 from remerge/update-template
Browse files Browse the repository at this point in the history
Update template
  • Loading branch information
hollow committed Oct 12, 2023
2 parents 2e118fb + 45a16fa commit 636db83
Show file tree
Hide file tree
Showing 9 changed files with 490 additions and 578 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
profile: production

exclude_paths:
- .ansible/collections
- .ansible/roles
Expand Down
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
# Changes here will be overwritten by Copier
_commit: v2.0.1
_commit: v2.1.3
_src_path: gh:remerge/template
project_id: ansible-role-nomad
project_license: apache-2.0
project_name: Ansible Role for Nomad
project_owner: core
project_type: ansible-role
run_workflows_for_all_branches: false
use_python: true
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ dotenv_if_exists
# Add local scripts to PATH
PATH_add "${PWD}/bin"

# Enforce correct 1Password account
export OP_ACCOUNT=remerge.1password.com

# Disable macOS fork safety for Python compatibility
# https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#running-on-macos
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ repos:

# https://github.com/pre-commit/mirrors-prettier/tags
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
rev: "v3.0.3"
hooks:
- id: prettier
exclude: "^project/"

# https://github.com/igorshubovych/markdownlint-cli/tags
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: "v0.35.0"
rev: "v0.37.0"
hooks:
- id: markdownlint-fix
name: markdownlint
Expand All @@ -67,14 +67,14 @@ repos:

# https://github.com/rhysd/actionlint/tags
- repo: https://github.com/rhysd/actionlint
rev: "v1.6.25"
rev: "v1.6.26"
hooks:
- id: actionlint-docker
name: actionlint

# https://github.com/ansible/ansible-lint/tags
- repo: https://github.com/ansible/ansible-lint
rev: "v6.17.2"
rev: "v6.20.0"
hooks:
- id: ansible-lint
name: ansible-lint
Expand All @@ -96,7 +96,7 @@ repos:

# https://github.com/bridgecrewio/checkov/tags
- repo: https://github.com/bridgecrewio/checkov
rev: "2.3.340"
rev: "2.4.48"
hooks:
- id: checkov
name: checkov
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
},
"python.defaultInterpreterPath": ".venv/bin/python",
"ansible.python.interpreterPath": ".venv/bin/python",
"yaml.schemas": {
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json": "playbooks/inventory.yaml"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ brew install --cask docker
brew install pre-commit pipx direnv copier
brew install poetry
```

Once `pre-commit` hook is activated (`make pre-commit-install`),
set of formatting and linting routines is run automatically on each commit.
The step could be avoided by providing `--no-verify` flag for `git commit`.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,12 @@ update:: copier-update

## pre-commit

.git/hooks/pre-commit:
make pre-commit-install

.PHONY: pre-commit-install
pre-commit-install: ## install pre-commit hook
pre-commit install -t pre-commit -t prepare-commit-msg -t commit-msg
install:: pre-commit-install

.PHONY: pre-commit-check
pre-commit-check: ## run pre commit hooks
pre-commit-check: .git/hooks/pre-commit
pre-commit run --all-files
check:: pre-commit-check

Expand Down
1,024 changes: 464 additions & 560 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ authors = ["Remerge GmbH <core@remerge.io>"]
python = "^3.9"

[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
flake8 = "^6.0.0"
flake8-bugbear = "^23.7.10"
pylint = "^2.17.4"
tox = "^4.6.4"
molecule = { extras = ["docker"], version = "^5.1.0" }
ansible-lint = { version = "^6.17.2", markers = "platform_system != 'Windows'" }
black = "^23.9.1"
flake8 = "^6.1.0"
flake8-bugbear = "^23.9.16"
pylint = "^2.17.5"
tox = "^4.11.3"
molecule = { extras = ["docker"], version = "^6.0.2" }
ansible-lint = { version = "^6.20.0", markers = "platform_system != 'Windows'" }

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 636db83

Please sign in to comment.