1*6caecf96SSergey Zheltov#!/bin/bash 2*6caecf96SSergey Zheltov# 3*6caecf96SSergey Zheltov# Copyright (c) 2021 Intel Corporation 4*6caecf96SSergey Zheltov# 5*6caecf96SSergey Zheltov# Licensed under the Apache License, Version 2.0 (the "License"); 6*6caecf96SSergey Zheltov# you may not use this file except in compliance with the License. 7*6caecf96SSergey Zheltov# You may obtain a copy of the License at 8*6caecf96SSergey Zheltov# 9*6caecf96SSergey Zheltov# http://www.apache.org/licenses/LICENSE-2.0 10*6caecf96SSergey Zheltov# 11*6caecf96SSergey Zheltov# Unless required by applicable law or agreed to in writing, software 12*6caecf96SSergey Zheltov# distributed under the License is distributed on an "AS IS" BASIS, 13*6caecf96SSergey Zheltov# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14*6caecf96SSergey Zheltov# See the License for the specific language governing permissions and 15*6caecf96SSergey Zheltov# limitations under the License. 16*6caecf96SSergey Zheltov 17*6caecf96SSergey ZheltovSCAN_TARGET=$1 18*6caecf96SSergey Zheltov 19*6caecf96SSergey ZheltovSKIP_PATTERN='*/.github/*' 20*6caecf96SSergey Zheltov 21*6caecf96SSergey Zheltov# Ignored cases 22*6caecf96SSergey ZheltovIGNORE_COMMAND="sed -e /.*\\sOd\\s*=.*/d \ 23*6caecf96SSergey Zheltov-e /.*\\sOt\\s*=.*/d \ 24*6caecf96SSergey Zheltov-e /.*\\siff\\s*=.*/d \ 25*6caecf96SSergey Zheltov-e /.*\\sith\\s*=.*/d \ 26*6caecf96SSergey Zheltov-e /.*\\scas\\s*=.*/d \ 27*6caecf96SSergey Zheltov-e /.*\\sCAS\\s*=.*/d \ 28*6caecf96SSergey Zheltov-e /.*\\ssom\\s*=.*/d \ 29*6caecf96SSergey Zheltov-e /.*\\sSOM\\s*=.*/d \ 30*6caecf96SSergey Zheltov-e /.*\\suint\\s*=.*/d \ 31*6caecf96SSergey Zheltov-e /.*\\sUINT\\s*=.*/d \ 32*6caecf96SSergey Zheltov-e /.*\\scopyable\\s*=.*/d \ 33*6caecf96SSergey Zheltov-e /.*\\sCopyable\\s*=.*/d \ 34*6caecf96SSergey Zheltov-e /.*\\sFo\\s*=.*/d \ 35*6caecf96SSergey Zheltov-e /.*pipeline_filters.h.*nd\\s*=.*/d \ 36*6caecf96SSergey Zheltov-e /.*ittnotify.h.*unx\\s*=.*/d \ 37*6caecf96SSergey Zheltov-e /.*bzlib.cpp.*MSDOS\\s*=.*/d \ 38*6caecf96SSergey Zheltov-e /.*test_task.cpp.*tE\\s*=.*/d \ 39*6caecf96SSergey Zheltov-e /.*backend.cpp.*resSize\\s*=.*/d \ 40*6caecf96SSergey Zheltov-e /.*test_join_node.h.*Ned\\s*=.*/d \ 41*6caecf96SSergey Zheltov-e /.*test_indexer_node.cpp.*OT\\s*=.*/d \ 42*6caecf96SSergey Zheltov-e /.*allocator_stl_test_common.h.*Aci*\\s*=.*/d \ 43*6caecf96SSergey Zheltov-e /.*seismic_video.cpp.*DialogBox\\s*=.*/d \ 44*6caecf96SSergey Zheltov-e /.*test_composite_node.cpp.*que\\s*=.*/d \ 45*6caecf96SSergey Zheltov-e /.*blocksort.cpp.*hiSt\\s*=.*/d \ 46*6caecf96SSergey Zheltov-e /.*compress.cpp.*fave\\s*=.*/d \ 47*6caecf96SSergey Zheltov-e /.*count_strings.cpp.*ue\\s*=.*/d \ 48*6caecf96SSergey Zheltov-e /.*count_strings.cpp.*nd\\s*=.*/d \ 49*6caecf96SSergey Zheltov-e /.*count_strings.cpp.*ths\\s*=.*/d \ 50*6caecf96SSergey Zheltov-e /.*polygon_overlay\/README.md.*ist\\s*=.*/d \ 51*6caecf96SSergey Zheltov-e /.*_pipeline_filters.h.*nd\\s*=.*/d \ 52*6caecf96SSergey Zheltov-e /.*sub_string_finder\/README.md.*ba\\s*=.*/d" 53*6caecf96SSergey Zheltov 54*6caecf96SSergey ZheltovSCAN_RESULT=`codespell --quiet-level=2 --skip "${SKIP_PATTERN}" ${SCAN_TARGET}` 55*6caecf96SSergey ZheltovSCAN_RESULT=`echo -e "${SCAN_RESULT}" | ${IGNORE_COMMAND}` 56*6caecf96SSergey Zheltovecho "${SCAN_RESULT}" 57*6caecf96SSergey Zheltov 58*6caecf96SSergey Zheltovif [[ ! -z ${SCAN_RESULT} ]]; then 59*6caecf96SSergey Zheltov exit 1 60*6caecf96SSergey Zheltovfi 61