mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-01-03 11:22:15 +01:00
Added the possibility to include all file extensions in the analysis.
This functionality was briefly discussed in issue #61. To make gitinspector consider all file extensions, it is now possible to supply a double asterisk "**" to the list of file extensions.
This commit is contained in:
parent
243e52b5de
commit
3e88fcb71a
2 changed files with 11 additions and 4 deletions
|
@ -71,7 +71,7 @@ class FileDiff:
|
||||||
extension = FileDiff.get_extension(string)
|
extension = FileDiff.get_extension(string)
|
||||||
|
|
||||||
for i in extensions.get():
|
for i in extensions.get():
|
||||||
if (extension == "" and i == "*") or extension == i:
|
if (extension == "" and i == "*") or extension == i or i == '**':
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -46,13 +46,20 @@ EXTENSIONS_INFO_TEXT = N_("The extensions below were found in the repository his
|
||||||
EXTENSIONS_MARKED_TEXT = N_("(extensions used during statistical analysis are marked)")
|
EXTENSIONS_MARKED_TEXT = N_("(extensions used during statistical analysis are marked)")
|
||||||
|
|
||||||
class Extensions(Outputable):
|
class Extensions(Outputable):
|
||||||
|
@staticmethod
|
||||||
|
def is_marked(extension):
|
||||||
|
if extension in __extensions__ or "**" in __extensions__:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def output_html(self):
|
def output_html(self):
|
||||||
if __located_extensions__:
|
if __located_extensions__:
|
||||||
extensions_xml = "<div><div class=\"box\">"
|
extensions_xml = "<div><div class=\"box\">"
|
||||||
extensions_xml += "<p>{0} {1}.</p><p>".format(_(EXTENSIONS_INFO_TEXT), _(EXTENSIONS_MARKED_TEXT))
|
extensions_xml += "<p>{0} {1}.</p><p>".format(_(EXTENSIONS_INFO_TEXT), _(EXTENSIONS_MARKED_TEXT))
|
||||||
|
|
||||||
for i in sorted(__located_extensions__):
|
for i in sorted(__located_extensions__):
|
||||||
if i in __extensions__:
|
if Extensions.is_marked(i):
|
||||||
extensions_xml += "<strong>" + i + "</strong>"
|
extensions_xml += "<strong>" + i + "</strong>"
|
||||||
else:
|
else:
|
||||||
extensions_xml += i
|
extensions_xml += i
|
||||||
|
@ -67,7 +74,7 @@ class Extensions(Outputable):
|
||||||
width=terminal.get_size()[0]))
|
width=terminal.get_size()[0]))
|
||||||
|
|
||||||
for i in sorted(__located_extensions__):
|
for i in sorted(__located_extensions__):
|
||||||
if i in __extensions__:
|
if Extensions.is_marked(i):
|
||||||
print("[" + terminal.__bold__ + i + terminal.__normal__ + "]", end=" ")
|
print("[" + terminal.__bold__ + i + terminal.__normal__ + "]", end=" ")
|
||||||
else:
|
else:
|
||||||
print (i, end=" ")
|
print (i, end=" ")
|
||||||
|
@ -80,7 +87,7 @@ class Extensions(Outputable):
|
||||||
unused_extensions_xml = ""
|
unused_extensions_xml = ""
|
||||||
|
|
||||||
for i in sorted(__located_extensions__):
|
for i in sorted(__located_extensions__):
|
||||||
if i in __extensions__:
|
if Extensions.is_marked(i):
|
||||||
used_extensions_xml += "\t\t\t<extension>" + i + "</extension>\n"
|
used_extensions_xml += "\t\t\t<extension>" + i + "</extension>\n"
|
||||||
else:
|
else:
|
||||||
unused_extensions_xml += "\t\t\t<extension>" + i + "</extension>\n"
|
unused_extensions_xml += "\t\t\t<extension>" + i + "</extension>\n"
|
||||||
|
|
Loading…
Reference in a new issue