Skip to content

Instantly share code, notes, and snippets.

@jairideout
Created December 22, 2016 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jairideout/0b0cec5146c807e6540c4c989146fef7 to your computer and use it in GitHub Desktop.
Save jairideout/0b0cec5146c807e6540c4c989146fef7 to your computer and use it in GitHub Desktop.
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
import os
import os.path
def main():
for dirpath, dirnames, filenames in os.walk('.'):
for filename in filenames:
filepath = os.path.join(dirpath, filename)
if not filepath.endswith('.py'):
continue
with open(filepath, 'r') as filehandle:
lines = ''.join(line for _, line in zip(range(7), filehandle))
if lines != HEADER:
print('Invalid header: %s' % filepath)
HEADER = """\
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
"""
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment