-
Notifications
You must be signed in to change notification settings - Fork 75
try windows support #134
base: master
Are you sure you want to change the base?
try windows support #134
Changes from 3 commits
8c42ddc
ef48d84
3306381
98ce759
6334dd7
d78f78a
ace7296
1bf8968
c43e541
9156e93
556679e
4955e3f
91343a7
da4beda
a700988
0263092
9b9705b
88b33ca
f25c299
9f803c2
9822480
48f9c41
0b3521c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,8 @@ | |
|
|
||
| import docopt | ||
| import termcolor | ||
| import colorama | ||
|
||
| colorama.init() | ||
| import yaml | ||
|
|
||
| import gitlint.git as git | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
|
|
||
| # This can be just pathlib when 2.7 and 3.4 support is dropped. | ||
| import pathlib2 as pathlib | ||
| from shutil import which | ||
|
||
|
|
||
|
|
||
| def filter_lines(lines, filter_regex, groups=None): | ||
|
|
@@ -43,22 +44,6 @@ def filter_lines(lines, filter_regex, groups=None): | |
| yield tuple(matched_groups.get(group) for group in groups) | ||
|
|
||
|
|
||
| # TODO(skreft): add test | ||
| def which(program): | ||
| """Returns a list of paths where the program is found.""" | ||
| if (os.path.isabs(program) and os.path.isfile(program) | ||
| and os.access(program, os.X_OK)): | ||
| return [program] | ||
|
|
||
| candidates = [] | ||
| locations = os.environ.get("PATH").split(os.pathsep) | ||
| for location in locations: | ||
| candidate = os.path.join(location, program) | ||
| if os.path.isfile(candidate) and os.access(candidate, os.X_OK): | ||
| candidates.append(candidate) | ||
| return candidates | ||
|
|
||
|
|
||
| def programs_not_in_path(programs): | ||
| """Returns all the programs that are not found in the PATH.""" | ||
| return [program for program in programs if not which(program)] | ||
|
|
@@ -75,6 +60,7 @@ def _open_for_write(filename): | |
| def _get_cache_filename(name, filename): | ||
| """Returns the cache location for filename and linter name.""" | ||
| filename = os.path.abspath(filename)[1:] | ||
| filename = filename.lstrip(":\\") # for windows | ||
|
||
| home_folder = os.path.expanduser('~') | ||
| base_cache_dir = os.path.join(home_folder, '.git-lint', 'cache') | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| termcolor | ||
|
||
| colorama | ||
| nose | ||
| docopt | ||
| pyfakefs | ||
| pyyaml | ||
| pathlib2 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary as the pip command above is also installing dev and test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I see
coloramawill installed: travis-jobs