From a2d39c810a13b3738af75c1db73568b15fcd3a87 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Mon, 14 Dec 2020 20:12:57 +0300 Subject: [PATCH] Pull request: dnsfilter: restore enum value Merge in DNS/adguard-home from fix-filter-names to master Squashed commit of the following: commit 620d80df12878a1b236abb26cd2a331df998a3d5 Author: Ainar Garipov Date: Mon Dec 14 20:02:41 2020 +0300 dnsfilter: restore enum value --- .githooks/pre-commit | 23 +++++++++-------------- internal/dnsfilter/dnsfilter.go | 3 +++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index b4fb2ee1..f2bbf1c9 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,18 +1,13 @@ -#!/bin/bash -set -e; +#!/bin/sh -found=0 -git diff --cached --name-only | grep -q '.js$' && found=1 -if [ $found == 1 ]; then - npm --prefix client run lint || exit 1 - npm run test --prefix client || exit 1 +set -e -f -u + +if [ "$(git diff --cached --name-only '*.js')" ] +then + make js-lint js-test fi -found=0 -git diff --cached --name-only | grep -q '.go$' && found=1 -if [ $found == 1 ]; then - make go-lint || exit 1 - go test ./... || exit 1 +if [ "$(git diff --cached --name-only '*.go')" ] +then + make go-lint go-test fi - -exit 0; diff --git a/internal/dnsfilter/dnsfilter.go b/internal/dnsfilter/dnsfilter.go index 340bfaaf..2690507d 100644 --- a/internal/dnsfilter/dnsfilter.go +++ b/internal/dnsfilter/dnsfilter.go @@ -129,6 +129,9 @@ const ( NotFilteredNotFound Reason = iota // NotFilteredWhiteList - the host is explicitly whitelisted NotFilteredWhiteList + // NotFilteredError is return where there was an error during + // checking. Reserved, currently unused. + NotFilteredError // reasons for filtering