Repository: coala/coala

Issue:
Add setting that allows turning off the warning about patches not being auto applicable

And this should also be used for the force_show_patch mode in run_coala. importance/high

Opened via [gitter](https://gitter.im/coala/coala/?at=58600243c895451b751d1f73) by @sils


Discussion:
Can I work on this? Or is it too complicated? 
@Shade5 please go ahead :)
@sils Any hints on how to start?
@sils When in the warnings about the patch shown? What's the command?
Use git grep n your own please
@sils Is this the error message? I need to confirm as I've not see it.
```
if not action.is_applicable(result, file_dict, file_diff_dict):
            log_printer.warn('Selected default action {!r} for bear {!r} is '
                             'not applicable. Action not applied.'.format(
                                 action.get_metadata().name, result.origin))
            not_processed_results.append(result)
            continue
```
@Shade5 then you should first reproduce the error, how else would you be able to tell if you fixed it? (I think it's the one.)
So will I get the error if I remove QuotesBear (How do I do this?) and then run coala in a file with 
`print("s")`
It auto applies QuotesBear to `print('s')`
you'll get it if you take LineLengthBear and there are results and you run `coala -a` e.g.
@sils Please review https://github.com/coala/coala/pull/3434

Resolving patch:
diff --git a/coalib/parsing/DefaultArgParser.py b/coalib/parsing/DefaultArgParser.py
--- a/coalib/parsing/DefaultArgParser.py
+++ b/coalib/parsing/DefaultArgParser.py
@@ -128,6 +128,9 @@ def default_arg_parser(formatter_class=None):
     config_group.add_argument(
         '--flush-cache', const=True, action='store_const',
         help='rebuild the file cache')
+    config_group.add_argument(
+        '--no-autoapply-warn', const=True, action='store_const',
+        help='turn off warning about patches not being auto applicable')
 
     inputs_group = arg_parser.add_argument_group('Inputs')
 
diff --git a/coalib/processes/Processing.py b/coalib/processes/Processing.py
--- a/coalib/processes/Processing.py
+++ b/coalib/processes/Processing.py
@@ -114,7 +114,7 @@ def autoapply_actions(results,
     """
 
     default_actions, invalid_actions = get_default_actions(section)
-
+    no_autoapply_warn = bool(section.get('no_autoapply_warn', False))
     for bearname, actionname in invalid_actions.items():
         log_printer.warn('Selected default action {!r} for bear {!r} does '
                          'not exist. Ignoring action.'.format(actionname,
@@ -140,7 +140,8 @@ def autoapply_actions(results,
 
         applicable = action.is_applicable(result, file_dict, file_diff_dict)
         if applicable is not True:
-            log_printer.warn('{}: {}'.format(result.origin, applicable))
+            if not no_autoapply_warn:
+                log_printer.warn('{}: {}'.format(result.origin, applicable))
             not_processed_results.append(result)
             continue
 


Test patch:
diff --git a/tests/processes/ProcessingTest.py b/tests/processes/ProcessingTest.py
--- a/tests/processes/ProcessingTest.py
+++ b/tests/processes/ProcessingTest.py
@@ -582,6 +582,15 @@ def test_without_default_action_and_unapplicable(self):
 
         ApplyPatchAction.is_applicable = old_is_applicable
 
+        self.section.append(Setting(
+            'no_autoapply_warn', True))
+        autoapply_actions(self.results,
+                          {},
+                          {},
+                          self.section,
+                          self.log_printer)
+        self.assertTrue(self.log_queue.empty())
+
     def test_applicable_action(self):
         # Use a result whose action can be successfully applied.
         log_printer = self.log_printer