blob: 71ef278617ef19bd5c9cb9e9ae7007c1a35ef2be [file] [log] [blame]
Joey Armstrong393daca2023-07-06 08:47:54 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong7a9af442024-01-03 19:26:36 -05003# Copyright 2016-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong393daca2023-07-06 08:47:54 -04004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# -----------------------------------------------------------------------
17
18$(if $(DEBUG),$(warning ENTER))
19
20## -----------------------------------------------------------------------
21## -----------------------------------------------------------------------
22sca:
23 $(call banner-enter,$@)
24
25 @$(RM) -r ./sca-report
26 @mkdir -p ./sca-report
27 @echo "Running static code analysis..."
28 @${GOLANGCI_LINT} run --deadline=6m --out-format junit-xml ./... \
29 | tee ./sca-report/sca-report.xml
30 @echo ""
31 @echo "Static code analysis OK"
32
33 $(call banner-leave,$@)
34
35## -----------------------------------------------------------------------
36## -----------------------------------------------------------------------
37clean-sca :
38 @$(RM) -r ./sca-report
39 $(RM) ./sca-report/sca-report.xml
40
41## -----------------------------------------------------------------------
42## -----------------------------------------------------------------------
43clean :: clean-sca
44
45## -----------------------------------------------------------------------
46## -----------------------------------------------------------------------
47help ::
48 @echo ' sca Runs static code analysis with the golangci-lint tool'
49
50$(if $(DEBUG),$(warning LEAVE))
51
52# [EOF]