Skip to content

Commit 281e165

Browse files
committed
Updated logging and error messages
1 parent b7fa651 commit 281e165

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

linter.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
#
1212

1313
"""This module exports the Codeclimate plugin class."""
14+
import logging
1415
import os
1516
from SublimeLinter.lint import Linter, PermanentError, util
1617

1718

19+
logger = logging.getLogger('SublimeLinter.plugin.codeclimate')
20+
21+
1822
class Codeclimate(Linter):
1923
"""Provides an interface to codeclimate."""
2024
defaults = {
@@ -46,13 +50,14 @@ def cmd(self):
4650
abs_path = self.filename
4751
working_dir = self.get_working_dir()
4852

49-
msg = 'The file \'%s\' is not part of the working dir (%s). ' \
50-
'Please see the Linter\'s README.md to get further ' \
51-
'instructions.' % (abs_path, working_dir)
53+
msg = 'The file \'%s\' is not part of any open folder in ' \
54+
'SublimeText. Please see the Linter\'s README.md to ' \
55+
'get further instructions.' % (abs_path)
5256

5357
if not (abs_path.startswith(os.path.abspath(working_dir) + os.sep)):
58+
logger.warning(msg)
5459
self.notify_unassign()
55-
raise PermanentError(msg)
60+
raise PermanentError('File not part of an open folder in SublimeText.')
5661

5762
file = os.path.relpath(abs_path, working_dir)
5863
return ['codeclimate', 'analyze', '${args}', file, '${xoo}']

0 commit comments

Comments
 (0)