blob: 0dfb1b53073e40db23d037e850ab99f1722c20e4 [file] [log] [blame]
Joey Armstrong9fc4fa82022-12-19 18:38:40 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong903c69d2024-02-01 19:46:39 -05003# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong9fc4fa82022-12-19 18:38:40 -05004#
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# JSON_FILES ?= $(error JSON_FILES= is required)
19
20.PHONY: lint-license
21
22## -----------------------------------------------------------------------
23## -----------------------------------------------------------------------
24lint : lint-license
25
26lint-license-gargs += --recursive
27
28# ignore: png, xlsx
29# will utf8 be excluded(?)
30lint-license-gargs += --binary-files=without-match
31lint-license-gargs += --files-without-match
32
33# [TODO] license checking accepts either Copy or Apache.
34# [TODO] At least Copyright should be required (both?)
35lint-license-gargs += --extended-regexp
36lint-license-gargs += -e 'Copyright[[:space:]]+[[:digit:]]{4}'
37lint-license-gargs += -e 'Apache License'
38
39# [TODO] --strict, --strict-dates
40
41# Editor temp files
42lint-license-gargs += --exclude='*.~'
43lint-license-gargs += --exclude='*.swp'
44
45lint-license-gargs += --exclude-dir='.git'
46
47# TODO: Normalize into .venv for consistent filtering across projects.
48lint-license-gargs += --exclude-dir='vst_venv'
49lint-license-gargs += --exclude-dir='flog'
50
51lint-license-gargs += --exclude='*.json'
52lint-license-gargs += --exclude='*.md'
53lint-license-gargs += --exclude='*.out'
54lint-license-gargs += --exclude='*.pyc'
55lint-license-gargs += --exclude='*.xml'
56
57# [FILE(s)]
58lint-license-gargs += --exclude='VERSION'
59
60# [GIT]
61# lint-license-gargs += --exclude='.gitignore'
62# lint-license-gargs += --exclude='.gitreview'
63lint-license-gargs += --exclude='\.*'
64
65# [PYTHON]
66lint-license-gargs += --exclude='requirements.txt'
67
68# [WIP]
69lint-license-gargs += --exclude='patch'
70
71## -----------------------------------------------------------------------
72## -----------------------------------------------------------------------
73lint-license-new:
74 grep $(lint-license-gargs) $(dot)
75
76## -----------------------------------------------------------------------
77## Jenkins job checking logic.
78## -----------------------------------------------------------------------
79lint-license:
80 $(MAKEDIR)/lint/license/license-check.sh
81
82## -----------------------------------------------------------------------
83## -----------------------------------------------------------------------
84help ::
85 @echo " lint-license Verify sources contain a license block."
86 @echo " lint-license-new Grep driven replacement logic."
87
88# [EOF]