From 669a3e67566cafefd3e6cc145494cac2cf2804e2 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Tue, 7 Mar 2017 10:21:12 +0200 Subject: [PATCH] - Set pre-commit hooks version using tags instead of hashes. - Added clean target (use git clean). - Set shell parameters using set instead of appending to the shabang line. - Clean beforing testing in pre-commit. --- .pre-commit-config.yaml | 6 +++--- Makefile | 5 ++++- ssh-ca | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82d9ff6..c35f133 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ - repo: git://github.com/pre-commit/pre-commit-hooks - sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f + sha: v0.7.1 hooks: - id: check-added-large-files - id: check-yaml - id: check-merge-conflict - repo: https://www.shore.co.il/git/shell-pre-commit/ - sha: v0.1.0 + sha: v0.3.0 hooks: - id: shell-lint files: ssh-ca @@ -14,5 +14,5 @@ - id: test name: make test language: system - entry: make test + entry: make clean test files: ssh-ca|Makefile diff --git a/Makefile b/Makefile index f7dc457..ca86312 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ -.PHONY: install test +.PHONY: install test clean USERNAME = $$(whoami) +clean: + git clean -fdx + test: ssh_config sshd_config CA CA.pub users/$(USERNAME) hosts/localhost known_hosts $$(PATH=$$PATH:/usr/local/sbin:/usr/sbin:/sbin which sshd) -f sshd_config test "$$(ssh -F ssh_config test whoami)" = "$$USER" diff --git a/ssh-ca b/ssh-ca index 9a7b3d9..a0e812e 100755 --- a/ssh-ca +++ b/ssh-ca @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -eu error () { echo "$1" -- GitLab