internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: coala/coala

Issue:
Annotations: handling exceptions
When writing custom annotation, user should be able to access exceptions, that it's raising, to debug his function. Currently all that he gets is the information that something went wrong, e. g.

```
[WARNING][14:09:44] The bear ClangComplexityBear cannot be executed. Unable to convert parameter 'max_complexity' into type <function func at 0x7fa1b4d12d90>
```

This can be pretty easy fixed, by specifying exception [here](https://github.com/coala-analyzer/coala/blob/master/coalib/settings/FunctionMetadata.py#L105) and specifying in the docs what exception should annotations be allowed to raise.

This is related to https://github.com/coala-analyzer/coala/issues/1219 discussion. I think, maybe we need to figure out a better way to use exceptions so that there will be no need in catching broad ones, because they can hide bugs or other useful information.



Discussion:
Thanks for reporting this issue!

@coala-analyzer/coala-contributors, your aid is required, fellow coalaian. Help us triage and solving this issue!

Ah, this is kind of intended since this interacts with the user, if the bear wants a bool and the user doesn't give something booleable we want a neat message saying he should please use something bool-ish, right? We don't want to show him a traceback ideally.

There'll be an agreement on which exceptions are to be considered due to wrong type that was specified and which due to something wrong and unexpected happening inside custom annotation. So, it'll show message as it did when it's because the type is incorrect.

Alright so only catch TypeError essentially, let other things go through or show a traceback for them right there.


Resolving patch:
diff --git a/coalib/settings/FunctionMetadata.py b/coalib/settings/FunctionMetadata.py
--- a/coalib/settings/FunctionMetadata.py
+++ b/coalib/settings/FunctionMetadata.py
@@ -102,7 +102,7 @@ def _get_param(param, section, annotation):
 
         try:
             return annotation(section[param])
-        except:
+        except (TypeError, ValueError):
             raise ValueError("Unable to convert parameter {} into type "
                              "{}.".format(repr(param), annotation))
 


Test patch:
Repository: coala/coala

Issue:
Debug output should contain files that get checked



Discussion:
Thanks for reporting this issue!

Your aid is required, fellow coalaian. Help us triage and solving this issue!

CC @sils1297, @AbdealiJK


Resolving patch:
diff --git a/coalib/processes/Processing.py b/coalib/processes/Processing.py
--- a/coalib/processes/Processing.py
+++ b/coalib/processes/Processing.py
@@ -259,6 +259,8 @@ def get_file_dict(filename_list, log_printer):
                                       exception,
                                       log_level=LOG_LEVEL.WARNING)
 
+    log_printer.debug("Files that will be checked:\n" +
+                      "\n".join(file_dict.keys()))
     return file_dict
 
 


Test patch:
diff --git a/tests/processes/ProcessingTest.py b/tests/processes/ProcessingTest.py
--- a/tests/processes/ProcessingTest.py
+++ b/tests/processes/ProcessingTest.py
@@ -297,8 +297,10 @@ def test_get_file_dict(self):
         self.assertEqual(type(file_dict[self.testcode_c_path]),
                          tuple,
                          msg="files in file_dict should not be editable")
+        self.assertEqual("Files that will be checked:\n" + self.testcode_c_path,
+                         self.log_printer.log_queue.get().message)
 
-        # Non existent file
+    def test_get_file_dict_non_existent_file(self):
         file_dict = get_file_dict(["non_existent_file"], self.log_printer)
         self.assertEqual(file_dict, {})
         self.assertIn(("Failed to read file 'non_existent_file' because of "
Repository: coala/coala

Issue:
Don't suggest -L DEBUG, use -V instead
in some cases we tell users to use -L DEBUG, not sure if --verbose is easier to understand and also type



Discussion:
Thanks for reporting this issue! A coalaian will look at it soon.

agreeing :+1:

Ill do it


Resolving patch:
diff --git a/coalib/bears/Bear.py b/coalib/bears/Bear.py
--- a/coalib/bears/Bear.py
+++ b/coalib/bears/Bear.py
@@ -249,9 +249,8 @@ def execute(self, *args, **kwargs):
             result = self.run_bear_from_section(args, kwargs)
             return [] if result is None else list(result)
         except:
-            self.warn(
-                "Bear {} failed to run. Take a look at debug messages (`-L "
-                "DEBUG`) for further information.".format(name))
+            self.warn("Bear {} failed to run. Take a look at debug messages"
+                      " (`-V`) for further information.".format(name))
             self.debug(
                 "The bear {bear} raised an exception. If you are the writer "
                 "of this bear, please make sure to catch all exceptions. If "


Test patch:
diff --git a/tests/bears/BearTest.py b/tests/bears/BearTest.py
--- a/tests/bears/BearTest.py
+++ b/tests/bears/BearTest.py
@@ -89,7 +89,7 @@ def test_bad_bear(self):
         self.check_message(LOG_LEVEL.DEBUG)
         self.check_message(LOG_LEVEL.WARNING,
                            "Bear BadTestBear failed to run. Take a look at "
-                           "debug messages (`-L DEBUG`) for further "
+                           "debug messages (`-V`) for further "
                            "information.")
         # debug message contains custom content, dont test this here
         self.queue.get()
Repository: coala/coala

Issue:
Make exception tracebacks default
Instead of asking the user to run coala with `-L DEBUG`



Discussion:
Thanks for reporting this issue! A coalaian will look at it soon.

Not `difficulty/newcomer`, as we don't want to execute coala always in debug-mode.

Ill work on this
just more details please

CC @Uran198 does it make sense to address this issue before your PR is merged?

@Makman2 then what do we want?

Change exception tracebacks and related information from DEBUG to ERROR :+1:

@sils1297 I think it does. There are a lot of places where the current logging will be exchanged for default one, so this does not really change that number, so not adding more work, while I like this feature and I think it might be useful.

Ok @mgracer48 take a look at LogPrinter, it has a method to log exceptions. The traceback is debug by default, we probably want to make it info or something like that at least. You'll probably have to change a few tests as well.

Sorry i havent gotten to this i have been reading python books to improve my python and also havent had the time 

which test files?

the ones that will fail when you've done your changes :P

```
E       AssertionError: '' != '[DEBUG][18:36:51] 4 r34l ch4ll3n63: 123 Ä[35 chars]n→ d'
E       + [DEBUG][18:36:51] 4 r34l ch4ll3n63: 123 ÄÖü ABc @€¥ §&% {[( ←↓→↑ ĦŊħ ß°^ \
E       + → d

tests/output/printers/LogPrinterTest.py:60: AssertionError

```

Help?

@mgracer48 got a link to your commit / PR? :)

https://github.com/coala/coala/pull/2782

@Makman2 


Resolving patch:
diff --git a/coalib/output/printers/LogPrinter.py b/coalib/output/printers/LogPrinter.py
--- a/coalib/output/printers/LogPrinter.py
+++ b/coalib/output/printers/LogPrinter.py
@@ -115,7 +115,7 @@ def log_exception(self,
 
         self.log(log_level, message, timestamp=timestamp, **kwargs)
         self.log_message(
-            LogMessage(LOG_LEVEL.DEBUG,
+            LogMessage(LOG_LEVEL.INFO,
                        "Exception was:" + "\n" + traceback_str,
                        timestamp=timestamp),
             **kwargs)


Test patch:
diff --git a/tests/output/printers/LogPrinterTest.py b/tests/output/printers/LogPrinterTest.py
--- a/tests/output/printers/LogPrinterTest.py
+++ b/tests/output/printers/LogPrinterTest.py
@@ -112,7 +112,7 @@ def test_logging(self):
         self.assertTrue(uut.printer.string.startswith(
             "[ERROR][" + self.timestamp.strftime("%X") +
             "] Something failed.\n" +
-            "[DEBUG][" + self.timestamp.strftime("%X") +
+            "[INFO][" + self.timestamp.strftime("%X") +
             "] Exception was:"))
 
         uut.log_level = LOG_LEVEL.INFO
Repository: coala/coala

Issue:
Add more strings to Constants
Our Constants are located in coala/coalib/misc/Constants.py and there we hold options for `TRUE_STRINGS`. I think we should expand these true strings with more options, such as : `yep`,`ja` or even `hell yeah` (who knows what the user might come up with). Feel free to add your own suggestions if you think they fit.



Discussion:
Thanks for reporting this issue!

Your aid is required, fellow coalaian. Help us triage and solving this issue!

CC @sils1297, @AbdealiJK

`ya`, `da`

No side:

`njet`, `nee`, `nein`

As long as one doesn't mean the other in another language, you're fine :p

`njet` ?

`нет`, if you wish and if your .coafile supports unicode ^^.

want to get assigned

Sure thing! Good luck on it.

hey @yashhsethiya are you still working on this :)? if you need help feel free to contact us on gitter! https://gitter.im/coala-analyzer/coala

Newcomer here: would like to be assigned to this since @yashhsethiya doesn't seem to be working on it.

@erickzhao there you go! Feel free to take up existing work. If you do, make sure to mention @yashhsethiya as co author.


Resolving patch:
diff --git a/coalib/misc/Constants.py b/coalib/misc/Constants.py
--- a/coalib/misc/Constants.py
+++ b/coalib/misc/Constants.py
@@ -34,27 +34,69 @@
 
 TRUE_STRINGS = ['1',
                 'on',
+                'okay',
+                'ok',
+                'okey-dokey',
                 'y',
                 'yes',
                 'yeah',
+                'yea',
+                'ya',
+                'ye',
+                'yessir',
                 'sure',
                 'true',
+                'tru',
+                'uh-huh',
                 'definitely',
                 'yup',
+                'yep',
                 'right',
                 'aye',
+                'alright',
+                'alrighty',
+                'hell yeah',
+                'affirmative',
+                'certainly',
+                'definitely',
+                'absolutely',
+                'roger',
+                'righto',
+                'ja',
+                'da',
+                'si',
+                'oui',
+                'amen',
+                'totally',
+                '10-4',
                 'positive']
 
 FALSE_STRINGS = ['0',
                  'off',
                  'n',
                  'no',
+                 'nix',
                  'nope',
+                 'nop',
                  'nah',
+                 'nay',
                  'false',
+                 'uh-uh',
                  'wrong',
                  'none',
                  'nay',
+                 'hell no',
+                 'fat chance',
+                 'not a chance in hell',
+                 'not in a million years',
+                 'out of the question',
+                 'no siree',
+                 'no way',
+                 'nein',
+                 'njet',
+                 'nee',
+                 'non',
+                 'hakuna',
                  'negative']
 
 # This string contains many unicode characters to challenge tests.


Test patch:
Repository: coala/coala

Issue:
Wrong doc string syntax in coalib.bearlib.aspects.Root
The doc string of the `Root` aspectclass has a formatting issue at https://github.com/coala/coala/blob/master/coalib/bearlib/aspects/__init__.py#L61

You can see the wrongly rendered result at https://api.coala.io/en/latest/coalib.bearlib.aspects.html#module-coalib.bearlib.aspects


Discussion:
Hello, I want to work on this.
Sir,can you assign this bug to me?
@Siddhartha1234 as @gRSsomani was first I would assign him^^
@gRSsomani you haven't accepted your invitation to our org yet, please do so to get assigned :+1:
Thank you @Makman2 !! I have accepted the invitation. Please assign.

Resolving patch:
diff --git a/coalib/bearlib/aspects/__init__.py b/coalib/bearlib/aspects/__init__.py
--- a/coalib/bearlib/aspects/__init__.py
+++ b/coalib/bearlib/aspects/__init__.py
@@ -58,7 +58,8 @@ class Root(aspectbase, metaclass=aspectclass):
     >>> LineLength('Python', max_line_length="100").tastes
     {'max_line_length': 100}
 
-    If no settings are given, the defaults will be taken>
+    If no settings are given, the defaults will be taken:
+
     >>> LineLength('Python').tastes
     {'max_line_length': 80}
 


Test patch:
Repository: coala/coala

Issue:
ConsoleInteraction.py: Add param docs for functions



Discussion:
@adtac I'll take this up :+1: 
`print_diffs_info` and `print_results_formatted` are the functions which don't have doc right
@vijeth-aradhya sure, assigning you.

Resolving patch:
diff --git a/coalib/output/ConsoleInteraction.py b/coalib/output/ConsoleInteraction.py
--- a/coalib/output/ConsoleInteraction.py
+++ b/coalib/output/ConsoleInteraction.py
@@ -272,6 +272,12 @@ def print_result(console_printer,
 
 
 def print_diffs_info(diffs, printer):
+    """
+    Prints diffs information (number of additions and deletions) to the console.
+
+    :param diffs:    List of Diff objects containing corresponding diff info.
+    :param printer:  Object responsible for printing diffs on console.
+    """
     for filename, diff in sorted(diffs.items()):
         additions, deletions = diff.stats()
         printer.print(
@@ -289,6 +295,15 @@ def print_results_formatted(log_printer,
                             section,
                             result_list,
                             *args):
+    """
+    Prints results through the format string from the format setting done by
+    user.
+
+    :param log_printer:    Printer responsible for logging the messages.
+    :param section:        The section to which the results belong.
+    :param result_list:    List of Result objects containing the corresponding
+                           results.
+    """
     global _warn_deprecated_format_str
     default_format = ('id:{id}:origin:{origin}:file:{file}:line:{line}:'
                       'column:{column}:end_line:{end_line}:end_column:'


Test patch:
Repository: coala/coala

Issue:
move ConsoleInteractions.join_names to coala_utils (on gitlab)

difficulty low

Opened via [gitter](https://gitter.im/coala/community/?at=586f56a4af6b364a29387435) by @sils


Discussion:

Resolving patch:
diff --git a/coalib/output/ConsoleInteraction.py b/coalib/output/ConsoleInteraction.py
--- a/coalib/output/ConsoleInteraction.py
+++ b/coalib/output/ConsoleInteraction.py
@@ -24,6 +24,7 @@
 from coalib.results.RESULT_SEVERITY import (
     RESULT_SEVERITY, RESULT_SEVERITY_COLORS)
 from coalib.settings.Setting import Setting
+from coala_utils.string_processing.Core import join_names
 
 from pygments import highlight
 from pygments.formatters import (TerminalTrueColorFormatter,
@@ -470,29 +471,6 @@ def print_affected_lines(console_printer, file_dict, sourcerange):
                         sourcerange)
 
 
-def join_names(values):
-    """
-    Produces a string by concatenating the items in ``values`` with
-    commas, except the last element, which is concatenated with an "and".
-
-    >>> join_names(["apples", "bananas", "oranges"])
-    'apples, bananas and oranges'
-    >>> join_names(["apples", "bananas"])
-    'apples and bananas'
-    >>> join_names(["apples"])
-    'apples'
-
-    :param values:
-        A list of strings.
-    :return:
-        The concatenated string.
-    """
-    if len(values) > 1:
-        return ', '.join(values[:-1]) + ' and ' + values[-1]
-    else:
-        return values[0]
-
-
 def require_setting(setting_name, arr, section):
     """
     This method is responsible for prompting a user about a missing setting and


Test patch:
Repository: coala/coala

Issue:
Remove call_without_output from Shell.py L7
This line was used by the requirement classes, it isnt used anymore as they use sarge, so it should be removed.
difficulty/newcomer


Discussion:
The change I made in my first commit, triggered a number of issues, so I closed that [pull](https://github.com/coala/coala/issues/3601) request and am going to work again on it.
you should solve the issues, if you have any problems drop on gitter and ask!
Hey @sils, could you please assign this issue to me.

Resolving patch:
diff --git a/coalib/misc/Shell.py b/coalib/misc/Shell.py
--- a/coalib/misc/Shell.py
+++ b/coalib/misc/Shell.py
@@ -1,14 +1,6 @@
 from contextlib import contextmanager
-import functools
 import shlex
-from subprocess import PIPE, Popen, call, DEVNULL
-
-
-call_without_output = functools.partial(call, stdout=DEVNULL, stderr=DEVNULL)
-"""
-Uses subprocess.call to execute a command, but suppresses the output and
-the errors.
-"""
+from subprocess import PIPE, Popen
 
 
 @contextmanager


Test patch:
Repository: coala/coala

Issue:
aspects/meta.py: Typo error
<!-- Hello! If you're filing a bug, please include every step so as to help us reproduce it on our machines. If you're unsure about how to file an issue, use the issue template. If you need any help regarding usage of coala, check out the documentation or hit us up on chat. You can ignore or delete this text, it is commented and won't appear when the issue is submitted or previewed.

Chat: https://coala.io/chat
Issue Template: https://github.com/coala/coala/blob/master/CONTRIBUTING.rst#filing-issues
Documentation: https://docs.coala.io
-->
Replace `int` -> `in` in `search for tastes int the sub-aspectclass`

difficulty/newcomer


Discussion:

Resolving patch:
diff --git a/coalib/bearlib/aspects/meta.py b/coalib/bearlib/aspects/meta.py
--- a/coalib/bearlib/aspects/meta.py
+++ b/coalib/bearlib/aspects/meta.py
@@ -44,7 +44,7 @@ def subaspect(cls, subcls):
             attr: getattr(docs, attr, '') for attr in
             list(signature(Documentation).parameters.keys())[1:]})
 
-        # search for tastes int the sub-aspectclass
+        # search for tastes in the sub-aspectclass
         subtastes = {}
         for name, member in getmembers(subcls):
             if isinstance(member, Taste):


Test patch:
Repository: coala/coala

Issue:
Fail to install and py.test on docker environment.
<!-- Hello! If you're filing a bug, please include every step so as to help us reproduce it on our machines. If you're unsure about how to file an issue, use the issue template. If you need any help regarding usage of coala, check out the documentation or hit us up on chat. You can ignore or delete this text, it is commented and won't appear when the issue is submitted or previewed.

Chat: https://coala.io/chat
Issue Template: https://github.com/coala/coala/blob/master/CONTRIBUTING.rst#filing-issues
Documentation: https://docs.coala.io
-->
When I try to install by `python setup.py install`, it is failed with this message.
`UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 15224: ordinal not in range(128)`
Also, the same happening when I try to run unit test on local.
It needs to be fixed.



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,10 @@
 from coalib.misc.BuildManPage import BuildManPage
 
 try:
-    locale.getlocale()
+    lc = locale.getlocale()
+    pf = platform.system()
+    if pf != 'Windows' and lc == (None, None):
+        locale.setlocale(locale.LC_ALL, 'C.UTF-8')
 except (ValueError, UnicodeError):
     locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
 


Test patch:
diff --git a/tests/__init__.py b/tests/__init__.py
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -0,0 +1,11 @@
+import locale
+import platform
+
+
+try:
+    lc = locale.getlocale()
+    ps = platform.system()
+    if ps != 'Windows' and lc == (None, None):
+        locale.setlocale(locale.LC_ALL, 'C.UTF-8')
+except (ValueError, UnicodeError):
+    locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
Repository: coala/coala

Issue:
can't build docs due to multiple targets for cross-reference
I can't successfully build the docs using `python setup.py docs` with Sphinx 1.5.5 due to the following error

```
Warning, treated as error:
/home/thomas/gitrepos/coala/coalib/core/DependencyTracker.py:docstring of coalib.core.DependencyTracker.DependencyTracker.check_circular_dependencies:None: WARNING: more than one target found for cross-reference 'CircularDependencyError': coalib.collecting.Dependencies.CircularDependencyError, coalib.core.CircularDependencyError.CircularDependencyError
```

I had a look at the implementation of the two CircularDependenyError classes and they are quite similar, can't they be merged?


Discussion:
This might be related to the sphinx-1.5.5, since the docs-requirements.txt 1.4.9 is hardcoded.

Resolving patch:
diff --git a/coalib/core/DependencyTracker.py b/coalib/core/DependencyTracker.py
--- a/coalib/core/DependencyTracker.py
+++ b/coalib/core/DependencyTracker.py
@@ -293,7 +293,7 @@ def check_circular_dependencies(self):
          ...
         coalib.core.CircularDependencyError.CircularDependencyError: ...
 
-        :raises CircularDependencyError:
+        :raises coalib.core.CircularDependencyError.CircularDependencyError:
             Raised on circular dependency conflicts.
         """
         traverse_graph(
diff --git a/coalib/core/Graphs.py b/coalib/core/Graphs.py
--- a/coalib/core/Graphs.py
+++ b/coalib/core/Graphs.py
@@ -34,7 +34,7 @@ def traverse_graph(start_nodes, get_successive_nodes,
         A callable that is run on each edge during traversing. Takes in two
         parameters, the previous- and next-node which form an edge. The default
         is an empty function.
-    :raises CircularDependencyError:
+    :raises coalib.core.CircularDependencyError.CircularDependencyError:
         Raised when the graph is cyclic.
     """
     path = set()


Test patch:
Repository: coala/coala

Issue:
Support neovim (`nvim`) as an editor
```
[WARNING][14:15:54] The editor "nvim" is unknown to coala. Files won't be opened at the correct positions and other quirks might occur. Consider opening an issue at https://github.com/coala/coala/issues so we can add support for this editor. Supported editors are: atom, emacs, emacsclient, geany, gedit, gvim, kate, nano, subl, vim, xed
```

It's basically the same as `vim` so it could be just added to the allowed editors list and given the same behavior as `vim`.


Discussion:
Can I take this issue?
As there's no progress yet, reassigning to you @mubaris :+1:

Resolving patch:
diff --git a/coalib/results/result_actions/OpenEditorAction.py b/coalib/results/result_actions/OpenEditorAction.py
--- a/coalib/results/result_actions/OpenEditorAction.py
+++ b/coalib/results/result_actions/OpenEditorAction.py
@@ -39,6 +39,10 @@
         'file_arg_template': '{filename} +{line}',
         'gui': False
     },
+    'nvim': {
+        'file_arg_template': '{filename} +{line}',
+        'gui': False
+    },
     'nano': {
         'file_arg_template': '+{line},{column} {filename} ',
         'gui': False


Test patch: