Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 869d9bb

Browse files
committed
Allow setting cache-dir to False to omit the arg
The user can set `cache-dir` to `False` to omit the arg from the command completely. This is especially useful if the actual cache dir is configured in the `mypy.ini` file. Omit automatically in case the default location `.mypy_cache` exists. Likely it is populated and the right thing. In all cases do not manually edit `cmd`. Just set the setting and let SublimeLinter do the rest.
1 parent 65e6a55 commit 869d9bb

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

linter.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ def cmd(self):
9292
else:
9393
cmd.append('${temp_file}')
9494

95-
# Add a temporary cache dir to the command if none was specified.
96-
# Helps keep the environment clean
97-
# by not littering everything with `.mypy_cache` folders.
98-
if not self.settings.get('cache-dir'):
95+
# Compare against `''` so the user can set just `False`,
96+
# for example if the cache is configured in "mypy.ini".
97+
if self.settings.get('cache-dir') == '':
9998
cwd = self.get_working_dir()
10099
if not cwd: # abort silently
101100
self.notify_unassign()

0 commit comments

Comments
 (0)