Repository: rust-lang/rust-enhanced (language: rust)

Issue:
Clippy doesn't check #[cfg(test)]
### Sublime Text Version
Sublime Text 3 (Build 3208)

### Rust Enhanced Version
v2.20.0

### Operating system
Ubuntu 19.04

### Expected behavior
Clippy should lint tests when `"rust_syntax_checking_include_tests": "true"`.

### Actual behavior
Even with `"rust_syntax_checking_include_tests": "true"`, clippy won't lint tests.

### Steps to reproduce
1. Set `rust_syntax_checking_include_tests` to true, and `rust_syntax_checking_method` to clippy.



Discussion / hints:

Fix patch:
diff --git a/SyntaxCheckPlugin.py b/SyntaxCheckPlugin.py
index a27777e9..722c97c9 100755
--- a/SyntaxCheckPlugin.py
+++ b/SyntaxCheckPlugin.py
@@ -144,22 +144,12 @@ def get_rustc_messages(self):
         settings.load()
         command_info = cargo_settings.CARGO_COMMANDS[method]
 
-        if method == 'clippy':
-            # Clippy does not support cargo target filters, must be run for
-            # all targets.
-            cmd = settings.get_command(method, command_info, self.cwd,
-                self.cwd, force_json=True)
-            self.msg_rel_path = cmd['msg_rel_path']
-            p = rust_proc.RustProc()
-            p.run(self.window, cmd['command'], self.cwd, self, env=cmd['env'])
-            return p.wait()
-
         if method == 'no-trans':
             print('rust_syntax_checking_method == "no-trans" is no longer supported.')
             print('Please change the config setting to "check".')
             method = 'check'
 
-        if method != 'check':
+        if method not in ['check', 'clippy']:
             print('Unknown setting for `rust_syntax_checking_method`: %r' % (method,))
             return -1
 
diff --git a/rust/cargo_settings.py b/rust/cargo_settings.py
index f7a39eb1..56b5c7fb 100644
--- a/rust/cargo_settings.py
+++ b/rust/cargo_settings.py
@@ -93,7 +93,7 @@
     'clippy': {
         'name': 'Clippy',
         'command': 'clippy',
-        'allows_target': False,
+        'allows_target': True,
         'allows_target_triple': True,
         'allows_release': True,
         'allows_features': True,


Test patch: