From a5959a97ae53baa4908f84370458dbe35e188088 Mon Sep 17 00:00:00 2001 From: Guilherme Ventura de Souza Date: Fri, 21 May 2021 12:45:21 -0300 Subject: [PATCH] fix: update husky settings --- .eslintrc.js | 1 - .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ README.md | 2 +- src/validate.ts | 5 +++-- 5 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.eslintrc.js b/.eslintrc.js index 99d280d..f5f96ca 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,7 +5,6 @@ module.exports = { }, extends: [ 'standard', - 'prettier/@typescript-eslint', 'plugin:prettier/recommended', 'eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..fe346ef --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run lint && npm run cover && npm run build && npm run make-badges && git add 'README.md' diff --git a/README.md b/README.md index 40a1d1f..5de71fa 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ | Statements | Branches | Functions | Lines | | --------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| ![Statements](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Branches](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | +| ![Statements](https://img.shields.io/badge/Coverage-99.43%25-brightgreen.svg) | ![Branches](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/Coverage-97.96%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/Coverage-99.35%25-brightgreen.svg) | --- diff --git a/src/validate.ts b/src/validate.ts index a546ae7..0f2f207 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -3,7 +3,7 @@ import { hashesConst, readmePathConst, coveragePathConst } from './constants'; import { getCoveragePath, getReadmePath } from './helpers'; import { logger } from './logger'; -const { logInfo } = logger(); +const { logInfo, logError } = logger(); export const doesReadmeFileExist = (readmePath: string): Promise => { return new Promise((resolve, reject) => { @@ -69,5 +69,6 @@ export const checkConfig = (): Promise => { .then(() => { logInfo('- Readme hashes exist... ✔️.'); }) - .then(() => logInfo('Info: 1. Config check process ended')); + .then(() => logInfo('Info: 1. Config check process ended')) + .catch(error => logError(`Info: 1. Config error - ${error}`)) };