Repository: Bachmann1234/diff_cover

Issue:
diff-quality fails with ValueError: invalid literal for int() with base 10: '470]'
When running `diff-quality` tool I have the following exception:

```
Traceback (most recent call last):
  File "/usr/local/bin/diff-quality", line 8, in <module>
    sys.exit(main())
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/diff_quality_tool.py", line 348, in main
    percent_passing = generate_quality_report(
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/diff_quality_tool.py", line 261, in generate_quality_report
    reporter.generate_report(output_file)
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/report_generator.py", line 265, in generate_report
    report = template.render(self._context())
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/report_generator.py", line 314, in _context
    context = super().report_dict()
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/report_generator.py", line 187, in report_dict
    src_stats = {src: self._src_path_stats(src) for src in self.src_paths()}
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/report_generator.py", line 84, in src_paths
    for src, summary in self._diff_violations().items()
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/report_generator.py", line 176, in _diff_violations
    self._diff_violations_dict = {
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/report_generator.py", line 178, in <dictcomp>
    self._violations.violations(src_path),
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/violationsreporters/base.py", line 159, in violations
    self.violations_dict.update(self.driver.parse_reports([output]))
  File "/home/jenkins/.local/lib/python3.8/site-packages/diff_cover/violationsreporters/violations_reporter.py", line 469, in parse_reports
    violation = Violation(int(line_number), error_str)
ValueError: invalid literal for int() with base 10: '470]'
```

The reason for this is the following: `violations_reporter` expects, that the output for duplicating lines looks like:
```
file1.py:162: [R0801] Similar lines in 2 files
==file1:162
==student.views:4
```
but it can look like:
```
file1.py:162: [R0801] Similar lines in 2 files
==file1:[162:165]
==student.views:[4:7]
```
And the [`multi_line_violation_regex`](https://github.com/Bachmann1234/diff_cover/blob/61a0ae286a54e7fcbacf063d339ddace6fd84155/diff_cover/violationsreporters/violations_reporter.py#L405) regular expression `==(\w|.+):(.*)` cannot parse it correctly.

The correct regular expression is `==((?:\w|\.)+?):\[?(\d+)`.

Comments:

Patch:
diff --git a/diff_cover/violationsreporters/violations_reporter.py b/diff_cover/violationsreporters/violations_reporter.py
index c61aff6..75ae51f 100644
--- a/diff_cover/violationsreporters/violations_reporter.py
+++ b/diff_cover/violationsreporters/violations_reporter.py
@@ -402,7 +402,7 @@ class PylintDriver(QualityDriver):
         # Match lines of the form:
         # path/to/file.py:123: [C0111] Missing docstring
         # path/to/file.py:456: [C0111, Foo.bar] Missing docstring
-        self.multi_line_violation_regex = re.compile(r"==(\w|.+):(.*)")
+        self.multi_line_violation_regex = re.compile(r"==((?:\w|\.)+?):\[?(\d+)")
         self.dupe_code_violation_regex = re.compile(r"Similar lines in (\d+) files")
 
     def _process_dupe_code_violation(self, lines, current_line, message):


Test patch:
diff --git a/tests/test_violations_reporter.py b/tests/test_violations_reporter.py
index a4d4adc..927acbd 100644
--- a/tests/test_violations_reporter.py
+++ b/tests/test_violations_reporter.py
@@ -1279,6 +1279,11 @@ class TestPylintQualityReporterTest:
             import json
             import logging
             import random
+            file2.py:170: [R0801] Similar lines in 2 files
+            ==file1:[170:172]
+            ==student.views:[4:6]
+            import foo
+            import bar
             path/to/file2.py:100: [W0212, openid_login_complete] Access to a protected member
             """
                 )
@@ -1300,6 +1305,7 @@ class TestPylintQualityReporterTest:
             ),
             Violation(149, "C0324: Foo.__dict__: Comma not followed by a space"),
             Violation(162, "R0801: Similar lines in 2 files"),
+            Violation(170, "R0801: Similar lines in 2 files"),
             Violation(113, "W0613: cache_relation.clear_pk: Unused argument 'cls'"),
         ]