Skip to content

Commit

Permalink
fixup! [AIRFLOW-2779] Add license headers to doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
ashb committed Nov 13, 2018
1 parent 42e6c75 commit 65e3ebf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
10 changes: 7 additions & 3 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ requirements.txt
.travis.yml
.*pyc
.*lock
docs
.*md
dist
build
airflow.egg-info
Expand All @@ -29,7 +27,6 @@ CHANGELOG.txt
kerberos_auth.py
airflow_api_auth_backend_kerberos_auth_py.html
licenses/*
airflow/www/static/docs
parallel.js
underscore.js
jquery.dataTables.min.js
Expand All @@ -41,3 +38,10 @@ d3.v3.min.js
ace.js
airflow/www_rbac/node_modules
.*json
airflow/www/static/coverage/*
git_version
flake8_diff.sh

rat-results.txt
apache-airflow-.*\+incubating-source.tar.gz.*
apache-airflow-.*\+incubating-bin.tar.gz.*
19 changes: 18 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
# flake8: noqa
# Disable Flake8 because of all the sphinx imports
#
# Airflow documentation build configuration file, created by
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Airflow documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 9 20:50:01 2014.
#
# This file is execfile()d with the current directory set to its
Expand Down
24 changes: 6 additions & 18 deletions scripts/ci/6-check-license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ mkdir -p ${TMP_DIR}/lib
exit 1
}

# This is the target of a symlink in airflow/www/static/docs - and rat exclude doesn't cope with the symlink target doesn't exist
mkdir -p docs/_build/html/

echo "Running license checks. This can take a while."
$java_cmd -jar "$rat_jar" -E "$FWDIR"/.rat-excludes -d "$FWDIR" > rat-results.txt

Expand All @@ -82,24 +85,9 @@ fi
ERRORS="$(cat rat-results.txt | grep -e "??")"

if test ! -z "$ERRORS"; then
echo "Could not find Apache license headers in the following files:"
echo "$ERRORS"
COUNT=`echo "${ERRORS}" | wc -l`
# due to old builds can be removed later
rm -rf ${TMP_DIR}/rat-error-count
if [ ! -f ${TMP_DIR}/rat-error-count-builds ]; then
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && echo ${COUNT} > ${TMP_DIR}/rat-error-count-builds
OLD_COUNT=${COUNT}
else
typeset -i OLD_COUNT=$(cat ${TMP_DIR}/rat-error-count-builds)
fi
if [ ${COUNT} -gt ${OLD_COUNT} ]; then
echo "New missing licenses (${COUNT} vs ${OLD_COUNT}) detected. Please correct them by adding them to to header of your files"
exit 1
else
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && echo ${COUNT} > ${TMP_DIR}/rat-error-count-builds
fi
exit 0
echo >&2 "Could not find Apache license headers in the following files:"
echo >&2 "$ERRORS"
exit 1
else
echo -e "RAT checks passed."
fi

0 comments on commit 65e3ebf

Please sign in to comment.