Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-commit as GH Action to test #679

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .deepsource.toml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
25 changes: 21 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ repos:
- id: check-case-conflict
- id: check-json
- id: check-yaml
exclude: ^.cicd/
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: detect-aws-credentials
args:
- "--allow-missing-credentials"
- id: detect-private-key
- id: fix-byte-order-marker

- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
hooks:
- id: pyupgrade
exclude: ^tests/
args: [ "--py38-plus", "--keep-runtime-typing" ]

- repo: https://github.com/psf/black
Expand All @@ -32,10 +36,6 @@ repos:
- id: blacken-docs
additional_dependencies: [ black ]

- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand All @@ -50,3 +50,20 @@ repos:
entry: .scripts/cleanup_placebo.sh
require_serial: true
files: "tests/*.json$"

# - repo: https://github.com/aws-cloudformation/cfn-lint
# rev: v0.78.1
# hooks:
# - id: cfn-lint
# files: .cicd/.*\.(json|yml|yaml)$

- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
args: [ "-t", "error" ]

- repo: https://github.com/iamthefij/docker-pre-commit
rev: master
hooks:
- id: docker-compose-check
3 changes: 1 addition & 2 deletions .scripts/import_sam_policies_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MPL-2.0
# Copyright 2020-2021 John Mille <john@compose-x.io>

Expand Down Expand Up @@ -62,7 +61,7 @@ def find_files(filename, search_path):
TEMPLATE_FILE = find_files("policy_templates.json", ZIP_DIR.name)[0]
DEST_FILE_PATH = path.abspath("ecs_composex/iam/sam_policies.json")
print("Found source", TEMPLATE_FILE)
with open(TEMPLATE_FILE, "r") as file_fd:
with open(TEMPLATE_FILE) as file_fd:
original_content = json.loads(file_fd.read())
print("Outputting to", DEST_FILE_PATH)
with open(DEST_FILE_PATH, "w") as file_fd:
Expand Down
1 change: 0 additions & 1 deletion NOTICES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ License files can be found here
.. _Apache 2.0 License: https://www.apache.org/licenses/LICENSE-2.0.txt
.. _BSD-2 Clause License: https://opensource.org/licenses/BSD-2-Clause
.. _MIT license: https://opensource.org/licenses/MIT

1 change: 0 additions & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ Examples and walk-through

examples/lab
examples/nginx_simple

4 changes: 2 additions & 2 deletions e2e-examples/nginx_webapp/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ services:
deploy:
resources:
limits:
cpus: 0.5
cpus: "0.5"
memory: 256MB
reservations:
cpus: 0.1
cpus: "0.1"
memory: 128MB
2 changes: 1 addition & 1 deletion use-cases/blog.features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
ecs.task.family: bignicefamily
resources:
reservations:
cpus: '0.25'
cpus: "0.25"
memory: 1GB
environment:
LOGLEVEL: DEBUG
Expand Down
174 changes: 0 additions & 174 deletions use-cases/cfn_macro/raw_compose.yml

This file was deleted.