Joey Armstrong | 393daca | 2023-07-06 08:47:54 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
| 3 | # Copyright 2016-2023 Open Networking Foundation (ONF) and the ONF Contributors |
| 4 | # |
| 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 | ## ----------------------------------------------------------------------- |
| 22 | sca: |
| 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 | ## ----------------------------------------------------------------------- |
| 37 | clean-sca : |
| 38 | @$(RM) -r ./sca-report |
| 39 | $(RM) ./sca-report/sca-report.xml |
| 40 | |
| 41 | ## ----------------------------------------------------------------------- |
| 42 | ## ----------------------------------------------------------------------- |
| 43 | clean :: clean-sca |
| 44 | |
| 45 | ## ----------------------------------------------------------------------- |
| 46 | ## ----------------------------------------------------------------------- |
| 47 | help :: |
| 48 | @echo ' sca Runs static code analysis with the golangci-lint tool' |
| 49 | |
| 50 | $(if $(DEBUG),$(warning LEAVE)) |
| 51 | |
| 52 | # [EOF] |