Skip to content

Commit

Permalink
Move smoke tests to /pre-commit/ top level dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
levsha authored and Enzo Desiage committed Apr 14, 2023
1 parent 05ebed0 commit 364da3f
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitlab/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ go_deps.bzl @dfinity-lab/teams/idx

# [GitLab-CI]
/.pre-commit-config.yaml @dfinity-lab/teams/idx
/pre-commit/ @dfinity-lab/teams/idx
/.gitlab-ci.yml @dfinity-lab/teams/idx
/.gitlab/ @dfinity-lab/teams/idx
/.gitlab/CODEOWNERS @dfinity-lab/teams/owners-owners
Expand Down
6 changes: 3 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ alias(

alias(
name = "ruff-format",
actual = "//bazel/pre-commit:ruff-format",
actual = "//pre-commit:ruff-format",
)

test_suite(
Expand All @@ -43,7 +43,7 @@ alias(

alias(
name = "shfmt-format",
actual = "//bazel/pre-commit:shfmt-format",
actual = "//pre-commit:shfmt-format",
)

alias(
Expand All @@ -53,7 +53,7 @@ alias(

alias(
name = "ormolu-format",
actual = "//bazel/pre-commit:ormolu-format",
actual = "//pre-commit:ormolu-format",
)

alias(
Expand Down
8 changes: 4 additions & 4 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -353,22 +353,22 @@ load("//bazel:shfmt.bzl", "shfmt")
shfmt(name = "shfmt")

# ruff binary for fast python linting
load("//bazel/pre-commit:ruff.bzl", "ruff")
load("//pre-commit:ruff.bzl", "ruff")

ruff(name = "ruff")

# ormolu binary for haskell linting
load("//bazel/pre-commit:ormolu.bzl", "ormolu")
load("//pre-commit:ormolu.bzl", "ormolu")

ormolu(name = "ormolu")

# buf binary for protobuf linting
load("//bazel/pre-commit:buf.bzl", "buf")
load("//pre-commit:buf.bzl", "buf")

buf(name = "buf")

# shellcheck binary
load("//bazel/pre-commit:shellcheck.bzl", "shellcheck")
load("//pre-commit:shellcheck.bzl", "shellcheck")

shellcheck(name = "shellcheck")

Expand Down
11 changes: 0 additions & 11 deletions bazel/pre-commit/DFINITY-capitalization.sh

This file was deleted.

12 changes: 0 additions & 12 deletions bazel/pre-commit/do-not-merge.sh

This file was deleted.

File renamed without changes.
25 changes: 25 additions & 0 deletions pre-commit/DFINITY-capitalization.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -ueo pipefail

REPO_PATH="$(dirname "$(readlink "$WORKSPACE")")"
cd "$REPO_PATH"

set +e
git grep -I -n -E '\bDfinity\b' . ":(exclude)pre-commit/DFINITY-capitalization.sh"
E="$?"
set -e

case "$E" in
0)
echo "[-] Improper capitalisation of DFINITY" >&2
exit 1
;;
1)
exit 0
;;
*)
echo "The command exited with the code $E" >&2
exit "$E"
;;
esac
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions pre-commit/do-not-merge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -ueo pipefail

REPO_PATH="$(dirname "$(readlink "$WORKSPACE")")"
cd "$REPO_PATH"

set +e
git grep -I -i -n -E "DO[^\w]?NOT[^\w]?MERGE" . ":(exclude)pre-commit/BUILD.bazel" ":(exclude)pre-commit/do-not-merge.sh"
E="$?"
set -e

case "$E" in
0)
echo "[-] Cannot merge - DO NOT MERGE present in this MR" >&2
exit 1
;;
1)
exit 0
;;
*)
echo "The command exited with the code $E" >&2
exit "$E"
;;
esac
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 364da3f

Please sign in to comment.