Skip to content

Commit

Permalink
[pre-commit]Run basic pre-commit checks and bashate
Browse files Browse the repository at this point in the history
  • Loading branch information
gibizer committed May 10, 2024
1 parent d7e6810 commit f1a34f7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
exclude: ^vendor
- id: check-shebang-scripts-are-executable
exclude: ^vendor
- id: check-merge-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: check-yaml
args: [-m]
- id: check-json
- id: detect-private-key
- id: end-of-file-fixer
exclude: ^vendor
- id: no-commit-to-branch
- id: trailing-whitespace
exclude: ^vendor

- repo: https://github.com/openstack/bashate.git
rev: 2.1.1
hooks:
- id: bashate
entry: bashate --error .
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# openstack-k8s-operators-ci

## Description
Common scripts and tools for the openstack-k8s-operators CI that can be used inside or outside of any CI platform.
Common scripts and tools for the openstack-k8s-operators CI that can be used inside or outside of any CI platform.

## Test Coverage
The following tests are currently available to be run:
Expand Down
2 changes: 1 addition & 1 deletion osbs_dockerfile_template_scripts/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function replace_ARG_values() {
do
# Replace all Dockerfile ${ARGNAME} with the value from $ENVFILE
# Use non priting character $'\001' to ensure it's not in the value
# sed is preffered over envsubst
# sed is preffered over envsubst
sed -ir s$'\001'\${"$value"}$'\001'"${!value}"$'\001' "$input_dockerfile"

# Ensure none of the specified arguments is set
Expand Down
1 change: 0 additions & 1 deletion osbs_dockerfile_vars/osp-director-operator.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ IMAGE_SUMMARY="OSP Director Operator"
IMAGE_DESC="This image includes the osp-director-operator"

USER_ID=""

5 changes: 3 additions & 2 deletions stage_downstream_rebase.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Based on the stage_downstream_rebase.sh from dprince
# https://github.com/openstack-k8s-operators/osp-director-operator/pull/397
#
Expand Down Expand Up @@ -35,7 +36,7 @@ function download_operator_sdk() {
OPERATOR_SDK="${SDK_TMP_DIR}/operator-sdk"
}

# Do check if the branch is specified in upstream_to_downstream variable
# Do check if the branch is specified in upstream_to_downstream variable
function check_if_branch_exists() {
if [ -z ${upstream_to_downstream[${1}]} ]; then
echo "Upstream branch ${1} is not supported by this script !"
Expand Down Expand Up @@ -240,7 +241,7 @@ if [ -z "$operator_branch" ]; then
fi
popd
if [ -z "$operator_branch" ]; then
echo "ERROR: No upstream branch found!"
echo "ERROR: No upstream branch found!"
exit -1
fi
fi
Expand Down

0 comments on commit f1a34f7

Please sign in to comment.