-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace file detection with identify
- Loading branch information
Showing
8 changed files
with
50 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,12 @@ | ||
from __future__ import absolute_import | ||
from __future__ import unicode_literals | ||
|
||
|
||
PYTHON = 'Python' | ||
YAML = 'Yaml' | ||
TEMPLATE = 'Template' | ||
CSS = 'Css' | ||
MAKO_TEMPLATE = 'Mako_Template' | ||
JAVASCRIPT = 'Javascript' | ||
JAVA = 'Java' | ||
ILLUSTRATOR = 'Illustrator' | ||
HTML = 'Html' | ||
CCPP = 'C_C++' | ||
TEXT = 'Text' | ||
SQL = 'SQL' | ||
|
||
|
||
# Maps a set of file extensions to a nice name. | ||
# Updating this will cause that file type to be tracked for LinesOfCode metric. | ||
FILE_TYPE_MAP = { | ||
b'.py': PYTHON, | ||
|
||
b'.yaml': YAML, | ||
b'.yml': YAML, | ||
|
||
b'.css': CSS, | ||
b'.scss': CSS, | ||
|
||
b'.tmpl': TEMPLATE, | ||
|
||
b'.mako': MAKO_TEMPLATE, | ||
|
||
b'.js': JAVASCRIPT, | ||
|
||
b'.java': JAVA, | ||
|
||
b'.ai': ILLUSTRATOR, | ||
|
||
b'.htm': HTML, | ||
b'.html': HTML, | ||
|
||
b'.h': CCPP, | ||
b'.c': CCPP, | ||
b'.cpp': CCPP, | ||
|
||
b'.md': TEXT, | ||
b'.rst': TEXT, | ||
b'.csv': TEXT, | ||
b'.log': TEXT, | ||
b'.json': TEXT, | ||
b'.xml': TEXT, | ||
b'.txt': TEXT, | ||
|
||
b'.sql': SQL, | ||
} | ||
from identify import identify | ||
|
||
UNKNOWN = 'unknown' | ||
IGNORED_TAGS = frozenset(( | ||
identify.DIRECTORY, identify.SYMLINK, identify.FILE, | ||
identify.EXECUTABLE, identify.NON_EXECUTABLE, | ||
identify.TEXT, identify.BINARY, | ||
)) | ||
ALL_TAGS = frozenset((identify.ALL_TAGS - IGNORED_TAGS) | {UNKNOWN}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
}, | ||
install_requires=[ | ||
'flask', | ||
'identify', | ||
'jsonschema', | ||
'mako', | ||
'pyyaml', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters