Skip to content

Commit

Permalink
Merge pull request #1 from esc24/header_check
Browse files Browse the repository at this point in the history
Exclude 'build' and 'dist' directories.
  • Loading branch information
rhattersley committed Sep 17, 2012
2 parents 76aa74f + cfe7657 commit 29b09a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ def run(self):
cmd = std_name_cmd('lib')
self.spawn(cmd)

class MissingHeaderError(Exception):
"""
Raised when one or more files do not have the required copyright
and licence header.
"""
pass

class HeaderCheck(Command):
"""
Expand All @@ -142,6 +149,8 @@ class HeaderCheck(Command):
user_options = []

exclude_patterns = ('./setup.py',
'./build/*',
'./dist/*',
'./docs/iris/example_code/graphics/*.py',
'./docs/iris/src/developers_guide/documenting/*.py',
'./docs/iris/src/sphinxext/gen_gallery.py',
Expand Down Expand Up @@ -171,7 +180,7 @@ def run(self):

bad_paths = filter(self._header_bad, check_paths)
if bad_paths:
raise StandardError(bad_paths)
raise MissingHeaderError(bad_paths)

def _header_bad(self, path):
target = '(C) British Crown Copyright 2010 - 2012, Met Office'
Expand Down

0 comments on commit 29b09a2

Please sign in to comment.