From 398af87eb542759c7b9b0e7f269820e477b603b8 Mon Sep 17 00:00:00 2001 From: Robert-André Mauchin Date: Apr 03 2019 15:02:50 +0000 Subject: Exclude .github folder from doc/license detection --- diff --git a/go2rpm/__main__.py b/go2rpm/__main__.py index aa8d4cd..8d06295 100644 --- a/go2rpm/__main__.py +++ b/go2rpm/__main__.py @@ -130,7 +130,7 @@ def detect_license(goipath): def get_license_files(goipath): license_files = [] path = os.path.join(GIT_CACHEDIR, *get_repo_name(goipath)) - exclude = set(['vendor', 'example', 'examples', 'internal', 'Godeps', 'testdata', '_testdata']) + exclude = set(['vendor', 'example', 'examples', 'internal', 'Godeps', 'testdata', '_testdata', '.github']) matcher = re.compile("(COPYING|COPYING[\.\-].*|COPYRIGHT|COPYRIGHT[\.\-].*|EULA|EULA[\.\-].*|licen[cs]e|licen[cs]e.*|LICEN[CS]E|LICEN[CS]E[\.\-].*|.*[\.\-]LICEN[CS]E.*|NOTICE|NOTICE[\.\-].*|PATENTS|PATENTS[\.\-].*|UNLICEN[CS]E|UNLICEN[CS]E[\.\-].*|agpl[\.\-].*|gpl[\.\-].*|lgpl[\.\-].*|AGPL-.*[0-9].*|APACHE-.*[0-9].*|BSD-.*[0-9].*|CC-BY-.*|GFDL-.*[0-9].*|GNU-.*[0-9].*|GPL-.*[0-9].*|LGPL-.*[0-9].*|MIT-.*[0-9].*|MPL-.*[0-9].*|OFL-.*[0-9].*)") for root, dirs, files in os.walk(path, topdown=True): dirs[:] = [d for d in dirs if d not in exclude] @@ -143,7 +143,7 @@ def get_license_files(goipath): def get_doc_files(goipath): doc_files = [] path = os.path.join(GIT_CACHEDIR, *get_repo_name(goipath)) - exclude = set(['vendor', 'example', 'examples', 'internal', 'Godeps', 'testdata', '_testdata']) + exclude = set(['vendor', 'example', 'examples', 'internal', 'Godeps', 'testdata', '_testdata', '.github']) matcher = re.compile("(.*\.md|.*\.markdown|.*\.mdown|.*\.mkdn|.*\.rst|.*\.txt|AUTHORS|AUTHORS[\.\-].*|CONTRIBUTORS|CONTRIBUTORS[\.\-].*|README|README[\.\-].*|CHANGELOG|CHANGELOG[\.\-].*|TODO|TODO[\.\-].*)", re.IGNORECASE) licensesex = re.compile("(COPYING|COPYING[\.\-].*|COPYRIGHT|COPYRIGHT[\.\-].*|EULA|EULA[\.\-].*|licen[cs]e|licen[cs]e.*|LICEN[CS]E|LICEN[CS]E[\.\-].*|.*[\.\-]LICEN[CS]E.*|NOTICE|NOTICE[\.\-].*|PATENTS|PATENTS[\.\-].*|UNLICEN[CS]E|UNLICEN[CS]E[\.\-].*|agpl[\.\-].*|gpl[\.\-].*|lgpl[\.\-].*|AGPL-.*[0-9].*|APACHE-.*[0-9].*|BSD-.*[0-9].*|CC-BY-.*|GFDL-.*[0-9].*|GNU-.*[0-9].*|GPL-.*[0-9].*|LGPL-.*[0-9].*|MIT-.*[0-9].*|MPL-.*[0-9].*|OFL-.*[0-9].*)") for root, dirs, files in os.walk(path, topdown=True):