Skip to content

Commit

Permalink
[AIRFLOW-2779] Add license headers to doc files (apache#4178)
Browse files Browse the repository at this point in the history
This adds ASF license headers to all the .rst and .md files with the
exception of the Pull Request template (as that is included verbatim
when opening a Pull Request on Github which would be messy)
  • Loading branch information
ashb authored and galak75 committed Nov 23, 2018
1 parent 7f3f0da commit fc228d1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 24 deletions.
30 changes: 24 additions & 6 deletions .rat-excludes
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
# Note: these patterns are applied to single files or directories, not full paths
# coverage/* will ignore any coverage dir, but airflow/www/static/coverage/* will match nothing

.gitignore
.gitattributes
.airflowignore
.coverage
.coveragerc
.codecov.yml
.eslintrc
.eslintignore
.flake8
.rat-excludes
requirements.txt
.*log
.travis.yml
.*pyc
.*lock
docs
.*md
dist
build
airflow.egg-info
apache_airflow.egg-info
.idea
metastore_db
.*sql
.*svg
.*csv
CHANGELOG.txt
.*zip
.*lock
# Generated doc files
.*html
_build/*
_static/*
.buildinfo
searchindex.js

# Apache Rat does not detect BSD-2 clause properly
# it is compatible according to http://www.apache.org/legal/resolved.html#category-a
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 @@ -37,6 +49,12 @@ bootstrap-toggle.min.js
bootstrap-toggle.min.css
d3.v3.min.js
ace.js
airflow/www/static/coverage/*
airflow/git_version
scripts/ci/flake8_diff.sh
node_modules/*
.*json
coverage/*
git_version
flake8_diff.sh

rat-results.txt
apache-airflow-.*\+incubating-source.tar.gz.*
apache-airflow-.*\+incubating-bin.tar.gz.*
20 changes: 20 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# -*- coding: utf-8 -*-
#
# flake8: noqa
# Disable Flake8 because of all the sphinx imports
#
# 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.
#
Expand Down
24 changes: 6 additions & 18 deletions scripts/ci/check-license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ mkdir -p ${TRAVIS_CACHE}/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 @@ -84,24 +87,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 ${TRAVIS_CACHE}/rat-error-count
if [ ! -f ${TRAVIS_CACHE}/rat-error-count-builds ]; then
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && echo ${COUNT} > ${TRAVIS_CACHE}/rat-error-count-builds
OLD_COUNT=${COUNT}
else
typeset -i OLD_COUNT=$(cat ${TRAVIS_CACHE}/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} > ${TRAVIS_CACHE}/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 fc228d1

Please sign in to comment.