blob: a88f0ba78ba281b16697200f0135227cbb6f2f09 [file] [log] [blame]
Joey Armstrong83874cc2022-11-26 09:40:08 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong57bd70f2023-01-12 05:25:51 -05003# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong83874cc2022-11-26 09:40:08 -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
18JSON_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# TODO: Normalize into .venv for consistent filtering across projects.
42lint-license-gargs += --exclude-dir='.git'
43lint-license-gargs += --exclude-dir='vst_venv'
44lint-license-gargs += --exclude-dir='flog'
45
46lint-license-gargs += --exclude='*.json'
47lint-license-gargs += --exclude='*.md'
48lint-license-gargs += --exclude='*.pyc'
49lint-license-gargs += --exclude='*.xml'
50
51# [FILE(s)]
52lint-license-gargs += --exclude='VERSION'
53
54# [GIT]
55# lint-license-gargs += --exclude='.gitignore'
56# lint-license-gargs += --exclude='.gitreview'
57lint-license-gargs += --exclude='\.*'
58
59# [PYTHON]
60lint-license-gargs += --exclude='requirements.txt'
61
62# [WIP]
63lint-license-gargs += --exclude='patch'
64
65## -----------------------------------------------------------------------
66## -----------------------------------------------------------------------
67lint-license-new:
68 grep $(lint-license-gargs) $(dot)
69
70## -----------------------------------------------------------------------
71## Jenkins job checking logic.
72## -----------------------------------------------------------------------
73lint-license:
74 $(MAKEDIR)/lint/license/license-check.sh
75
76## -----------------------------------------------------------------------
77## -----------------------------------------------------------------------
78help::
79 @echo " lint-license Verify sources contain a license block."
80 @echo " lint-license-new Grep driven replacement logic."
81
82# [EOF]