From 21c6948791a46181e43c1f925bdcf660673aad06 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 16:51:59 +0200 Subject: [PATCH 01/17] Remove unused functions --- tests/test_regex.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 8429567..4717928 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -30,18 +30,6 @@ def close_view(self, view): view.set_scratch(True) view.close() - def assertMatch(self, string, expected): - linter = Linter(sublime.View(0), {}) - actual = list(linter.find_errors(string))[0] - # `find_errors` fills out more information we don't want to write down - # in the examples - self.assertEqual({k: actual[k] for k in expected.keys()}, expected) - - def assertNoMatch(self, string): - linter = Linter(sublime.View(0), {}) - actual = list(linter.find_errors(string)) - self.assertFalse(actual) - @p.expand( [ ( From 6ef8ff72444001a51076e30e9ae895b492902f05 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 17:33:03 +0200 Subject: [PATCH 02/17] Implement as end-to-end test --- tests/test_regex.py | 28 +++++++++++++++++++--------- unittesting.json | 5 +++++ 2 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 unittesting.json diff --git a/tests/test_regex.py b/tests/test_regex.py index 4717928..cc8c5d0 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -1,8 +1,10 @@ -import unittest import importlib import sublime +from unittesting import DeferrableTestCase + from SublimeLinter.lint.linter import get_linter_settings +from SublimeLinter.lint import events, util from SublimeLinter.tests.parameterized import parameterized as p @@ -11,7 +13,7 @@ Linter = LinterModule.Annotations -class TestRegex(unittest.TestCase): +class TestRegex(DeferrableTestCase): def create_window(self): sublime.run_command("new_window") window = sublime.active_window() @@ -37,8 +39,8 @@ def close_view(self, view): "scope:source.python", { "line": 0, - "col": 2, - "message": "The {} message".format(error_type), + "start": 2, + "msg": "The {} message".format(error_type), "error_type": error_type, }, ) @@ -50,15 +52,23 @@ def close_view(self, view): for word in words ] ) - def test_a(self, view_content, syntax, expected): + def test_end_to_end(self, view_content, syntax, expected): window = self.create_window() view = self.create_view(window) view.assign_syntax(syntax) - view.run_command('append', {'characters': view_content}) + fname = util.get_filename(view) + actual = None - settings = get_linter_settings(Linter, view, context=None) - linter = Linter(view, settings) - actual = list(linter.find_errors("_ignored by plugin"))[0] + @events.on("LINT_RESULT") + def on_result(filename, linter_name, errors, **kwargs): + nonlocal actual, fname + if linter_name == "annotations" and filename == fname: + actual = errors[0] + + self.addCleanup(events.off, on_result) + view.run_command('append', {'characters': view_content}) + yield lambda: actual is not None + assert actual self.assertEqual({k: actual[k] for k in expected.keys()}, expected) @p.expand( diff --git a/unittesting.json b/unittesting.json new file mode 100644 index 0000000..35e45a2 --- /dev/null +++ b/unittesting.json @@ -0,0 +1,5 @@ +{ + "deferred": true, + "verbosity": 2, + "capture_console": true +} From 95fd49b0232cd87ef3831a20c2cb5612fbbd499b Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 17:44:55 +0200 Subject: [PATCH 03/17] Factor out `await_lint_result` helper --- tests/test_regex.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index cc8c5d0..76106b0 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -57,19 +57,25 @@ def test_end_to_end(self, view_content, syntax, expected): view = self.create_view(window) view.assign_syntax(syntax) fname = util.get_filename(view) + + view.run_command('append', {'characters': view_content}) + result = yield from self.await_lint_result("annotations", fname) + actual = result[0] + self.assertEqual({k: actual[k] for k in expected.keys()}, expected) + + def await_lint_result(self, linter_name_, filename_): actual = None @events.on("LINT_RESULT") def on_result(filename, linter_name, errors, **kwargs): - nonlocal actual, fname - if linter_name == "annotations" and filename == fname: - actual = errors[0] + nonlocal actual + if linter_name == linter_name_ and filename == filename_: + actual = errors self.addCleanup(events.off, on_result) - view.run_command('append', {'characters': view_content}) + yield lambda: actual is not None - assert actual - self.assertEqual({k: actual[k] for k in expected.keys()}, expected) + return actual @p.expand( [ From 731f60112c3707efc7ec5eb71a880266d7b056c6 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 17:47:20 +0200 Subject: [PATCH 04/17] Simplify test by using view settings --- tests/test_regex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 76106b0..7669ba4 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -100,9 +100,9 @@ def test_set_word_group_to_null_issue_39( view = self.create_view(window) view.assign_syntax(syntax) view.run_command('append', {'characters': view_content}) + view.settings().set("SublimeLinter.linters.annotations.infos", None) settings = get_linter_settings(Linter, view, context=None) - settings["infos"] = [] linter = Linter(view, settings) actual = list(linter.find_errors("_ignored by plugin")) for i, error in enumerate(expected): From a766d270c1c6f660c03b51f6c81674a4bfd1b1eb Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 17:50:19 +0200 Subject: [PATCH 05/17] Make issue 39 test an end-to-end test --- tests/test_regex.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 7669ba4..fd3d51f 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -3,7 +3,6 @@ import sublime from unittesting import DeferrableTestCase -from SublimeLinter.lint.linter import get_linter_settings from SublimeLinter.lint import events, util from SublimeLinter.tests.parameterized import parameterized as p @@ -85,8 +84,8 @@ def on_result(filename, linter_name, errors, **kwargs): [ { "line": 1, - "col": 2, - "message": "The error message", + "start": 2, + "msg": "The error message", "error_type": "error", } ], @@ -99,11 +98,11 @@ def test_set_word_group_to_null_issue_39( window = self.create_window() view = self.create_view(window) view.assign_syntax(syntax) - view.run_command('append', {'characters': view_content}) + fname = util.get_filename(view) view.settings().set("SublimeLinter.linters.annotations.infos", None) + view.run_command('append', {'characters': view_content}) + + result = yield from self.await_lint_result("annotations", fname) - settings = get_linter_settings(Linter, view, context=None) - linter = Linter(view, settings) - actual = list(linter.find_errors("_ignored by plugin")) for i, error in enumerate(expected): - self.assertEqual({k: actual[i][k] for k in error.keys()}, error) + self.assertEqual({k: result[i][k] for k in error.keys()}, error) From b228539cfef622406e88fa3e4436200d6e8a090b Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 17:56:47 +0200 Subject: [PATCH 06/17] Generalize asserting the lint result --- tests/test_regex.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index fd3d51f..5382f0e 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -31,6 +31,10 @@ def close_view(self, view): view.set_scratch(True) view.close() + def assertResult(self, result, expected): + for actual, error in zip(result, expected): + self.assertEqual({k: actual[k] for k in error.keys()}, error) + @p.expand( [ ( @@ -59,8 +63,7 @@ def test_end_to_end(self, view_content, syntax, expected): view.run_command('append', {'characters': view_content}) result = yield from self.await_lint_result("annotations", fname) - actual = result[0] - self.assertEqual({k: actual[k] for k in expected.keys()}, expected) + self.assertResult(result, [expected]) def await_lint_result(self, linter_name_, filename_): actual = None @@ -104,5 +107,4 @@ def test_set_word_group_to_null_issue_39( result = yield from self.await_lint_result("annotations", fname) - for i, error in enumerate(expected): - self.assertEqual({k: result[i][k] for k in error.keys()}, error) + self.assertResult(result, expected) From ddb4958cfc551e0554dd60ed7cdd9507b3d0e096 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 17:57:48 +0200 Subject: [PATCH 07/17] Move `await_lint_result` up to the helper section --- tests/test_regex.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 5382f0e..119007a 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -35,6 +35,20 @@ def assertResult(self, result, expected): for actual, error in zip(result, expected): self.assertEqual({k: actual[k] for k in error.keys()}, error) + def await_lint_result(self, linter_name_, filename_): + actual = None + + @events.on("LINT_RESULT") + def on_result(filename, linter_name, errors, **kwargs): + nonlocal actual + if linter_name == linter_name_ and filename == filename_: + actual = errors + + self.addCleanup(events.off, on_result) + + yield lambda: actual is not None + return actual + @p.expand( [ ( @@ -65,20 +79,6 @@ def test_end_to_end(self, view_content, syntax, expected): result = yield from self.await_lint_result("annotations", fname) self.assertResult(result, [expected]) - def await_lint_result(self, linter_name_, filename_): - actual = None - - @events.on("LINT_RESULT") - def on_result(filename, linter_name, errors, **kwargs): - nonlocal actual - if linter_name == linter_name_ and filename == filename_: - actual = errors - - self.addCleanup(events.off, on_result) - - yield lambda: actual is not None - return actual - @p.expand( [ ( From 7bb6cd7f2ae7fbe51ddd469e5d5c4d02dd92d3db Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:13:29 +0200 Subject: [PATCH 08/17] Add test for #33 --- tests/test_regex.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/test_regex.py b/tests/test_regex.py index 119007a..1f941a7 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -49,6 +49,35 @@ def on_result(filename, linter_name, errors, **kwargs): yield lambda: actual is not None return actual + @p.expand( + [ + ( + "// NOTE(kaste): a note", + "scope:source.js", + [ + { + "line": 0, + "start": 3, + "msg": "(kaste): a note", + "error_type": "info", + } + ], + ) + ] + ) + def test_extract_author_issue_33( + self, view_content, syntax, expected + ): + window = self.create_window() + view = self.create_view(window) + view.assign_syntax(syntax) + fname = util.get_filename(view) + view.run_command('append', {'characters': view_content}) + + result = yield from self.await_lint_result("annotations", fname) + + self.assertResult(result, expected) + @p.expand( [ ( From e098102ceca34bde483d93d57967f8960261abe8 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:16:07 +0200 Subject: [PATCH 09/17] Extract `prepare_view` function --- tests/test_regex.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 1f941a7..4af596e 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -31,6 +31,13 @@ def close_view(self, view): view.set_scratch(True) view.close() + def prepare_view(self, view_content, syntax): + window = self.create_window() + view = self.create_view(window) + view.assign_syntax(syntax) + view.run_command('append', {'characters': view_content}) + return view + def assertResult(self, result, expected): for actual, error in zip(result, expected): self.assertEqual({k: actual[k] for k in error.keys()}, error) @@ -68,11 +75,8 @@ def on_result(filename, linter_name, errors, **kwargs): def test_extract_author_issue_33( self, view_content, syntax, expected ): - window = self.create_window() - view = self.create_view(window) - view.assign_syntax(syntax) + view = self.prepare_view(view_content, syntax) fname = util.get_filename(view) - view.run_command('append', {'characters': view_content}) result = yield from self.await_lint_result("annotations", fname) @@ -99,13 +103,11 @@ def test_extract_author_issue_33( ] ) def test_end_to_end(self, view_content, syntax, expected): - window = self.create_window() - view = self.create_view(window) - view.assign_syntax(syntax) + view = self.prepare_view(view_content, syntax) fname = util.get_filename(view) - view.run_command('append', {'characters': view_content}) result = yield from self.await_lint_result("annotations", fname) + self.assertResult(result, [expected]) @p.expand( @@ -127,12 +129,9 @@ def test_end_to_end(self, view_content, syntax, expected): def test_set_word_group_to_null_issue_39( self, view_content, syntax, expected ): - window = self.create_window() - view = self.create_view(window) - view.assign_syntax(syntax) - fname = util.get_filename(view) + view = self.prepare_view(view_content, syntax) view.settings().set("SublimeLinter.linters.annotations.infos", None) - view.run_command('append', {'characters': view_content}) + fname = util.get_filename(view) result = yield from self.await_lint_result("annotations", fname) From c556431c143e0acdacf1aee94b9ee5f3e9481b1e Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:23:36 +0200 Subject: [PATCH 10/17] Pass `view` instead of the filename to `await_lint_result` --- tests/test_regex.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 4af596e..3edcd58 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -2,10 +2,14 @@ import sublime from unittesting import DeferrableTestCase +from SublimeLinter.tests.parameterized import parameterized as p from SublimeLinter.lint import events, util -from SublimeLinter.tests.parameterized import parameterized as p + +MYPY = False +if MYPY: + from typing import Generator LinterModule = importlib.import_module('SublimeLinter-annotations.linter') @@ -42,11 +46,14 @@ def assertResult(self, result, expected): for actual, error in zip(result, expected): self.assertEqual({k: actual[k] for k in error.keys()}, error) - def await_lint_result(self, linter_name_, filename_): + def await_lint_result(self, linter_name_, view): + # type: (str, sublime.View) -> Generator[object, object, list[dict]] + filename_ = util.get_filename(view) actual = None @events.on("LINT_RESULT") def on_result(filename, linter_name, errors, **kwargs): + # type: (str, str, list[dict], object) -> None nonlocal actual if linter_name == linter_name_ and filename == filename_: actual = errors @@ -54,6 +61,7 @@ def on_result(filename, linter_name, errors, **kwargs): self.addCleanup(events.off, on_result) yield lambda: actual is not None + assert actual return actual @p.expand( @@ -76,10 +84,7 @@ def test_extract_author_issue_33( self, view_content, syntax, expected ): view = self.prepare_view(view_content, syntax) - fname = util.get_filename(view) - - result = yield from self.await_lint_result("annotations", fname) - + result = yield from self.await_lint_result("annotations", view) self.assertResult(result, expected) @p.expand( @@ -104,10 +109,7 @@ def test_extract_author_issue_33( ) def test_end_to_end(self, view_content, syntax, expected): view = self.prepare_view(view_content, syntax) - fname = util.get_filename(view) - - result = yield from self.await_lint_result("annotations", fname) - + result = yield from self.await_lint_result("annotations", view) self.assertResult(result, [expected]) @p.expand( @@ -131,8 +133,7 @@ def test_set_word_group_to_null_issue_39( ): view = self.prepare_view(view_content, syntax) view.settings().set("SublimeLinter.linters.annotations.infos", None) - fname = util.get_filename(view) - result = yield from self.await_lint_result("annotations", fname) + result = yield from self.await_lint_result("annotations", view) self.assertResult(result, expected) From 9456d16d0d1bfd261b6470066acd3f8caaa53f06 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:26:56 +0200 Subject: [PATCH 11/17] Flip arguments of `await_lint_result` --- tests/test_regex.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 3edcd58..e3fe92e 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -46,8 +46,8 @@ def assertResult(self, result, expected): for actual, error in zip(result, expected): self.assertEqual({k: actual[k] for k in error.keys()}, error) - def await_lint_result(self, linter_name_, view): - # type: (str, sublime.View) -> Generator[object, object, list[dict]] + def await_lint_result(self, view, linter_name_): + # type: (sublime.View, str) -> Generator[object, object, list[dict]] filename_ = util.get_filename(view) actual = None @@ -84,7 +84,7 @@ def test_extract_author_issue_33( self, view_content, syntax, expected ): view = self.prepare_view(view_content, syntax) - result = yield from self.await_lint_result("annotations", view) + result = yield from self.await_lint_result(view, "annotations") self.assertResult(result, expected) @p.expand( @@ -109,7 +109,7 @@ def test_extract_author_issue_33( ) def test_end_to_end(self, view_content, syntax, expected): view = self.prepare_view(view_content, syntax) - result = yield from self.await_lint_result("annotations", view) + result = yield from self.await_lint_result(view, "annotations") self.assertResult(result, [expected]) @p.expand( @@ -134,6 +134,6 @@ def test_set_word_group_to_null_issue_39( view = self.prepare_view(view_content, syntax) view.settings().set("SublimeLinter.linters.annotations.infos", None) - result = yield from self.await_lint_result("annotations", view) + result = yield from self.await_lint_result(view, "annotations") self.assertResult(result, expected) From 3868a9496809d780234a1624bf199709950d364d Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:29:02 +0200 Subject: [PATCH 12/17] Remove unused imports --- tests/test_regex.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index e3fe92e..70e1b42 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -1,5 +1,3 @@ -import importlib - import sublime from unittesting import DeferrableTestCase from SublimeLinter.tests.parameterized import parameterized as p @@ -12,10 +10,6 @@ from typing import Generator -LinterModule = importlib.import_module('SublimeLinter-annotations.linter') -Linter = LinterModule.Annotations - - class TestRegex(DeferrableTestCase): def create_window(self): sublime.run_command("new_window") From eb583bc2d46ab753d0871285de282f972f7ef764 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:30:45 +0200 Subject: [PATCH 13/17] Factor out `LintResultTestCase` --- tests/test_regex.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 70e1b42..8a5f16c 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -10,7 +10,7 @@ from typing import Generator -class TestRegex(DeferrableTestCase): +class LintResultTestCase(DeferrableTestCase): def create_window(self): sublime.run_command("new_window") window = sublime.active_window() @@ -58,6 +58,8 @@ def on_result(filename, linter_name, errors, **kwargs): assert actual return actual + +class TestAnnotationsLinter(LintResultTestCase): @p.expand( [ ( From 4ccf78c5e2021492cadbf8007641bc778d094c15 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:32:39 +0200 Subject: [PATCH 14/17] Make `linter_name` a class member --- tests/test_regex.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index 8a5f16c..cfba03b 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -40,8 +40,10 @@ def assertResult(self, result, expected): for actual, error in zip(result, expected): self.assertEqual({k: actual[k] for k in error.keys()}, error) - def await_lint_result(self, view, linter_name_): + def await_lint_result(self, view, linter_name_=None): # type: (sublime.View, str) -> Generator[object, object, list[dict]] + if linter_name_ is None: + linter_name_ = self.linter_name filename_ = util.get_filename(view) actual = None @@ -60,6 +62,8 @@ def on_result(filename, linter_name, errors, **kwargs): class TestAnnotationsLinter(LintResultTestCase): + linter_name = "annotations" + @p.expand( [ ( @@ -80,7 +84,7 @@ def test_extract_author_issue_33( self, view_content, syntax, expected ): view = self.prepare_view(view_content, syntax) - result = yield from self.await_lint_result(view, "annotations") + result = yield from self.await_lint_result(view) self.assertResult(result, expected) @p.expand( @@ -105,7 +109,7 @@ def test_extract_author_issue_33( ) def test_end_to_end(self, view_content, syntax, expected): view = self.prepare_view(view_content, syntax) - result = yield from self.await_lint_result(view, "annotations") + result = yield from self.await_lint_result(view) self.assertResult(result, [expected]) @p.expand( @@ -130,6 +134,6 @@ def test_set_word_group_to_null_issue_39( view = self.prepare_view(view_content, syntax) view.settings().set("SublimeLinter.linters.annotations.infos", None) - result = yield from self.await_lint_result(view, "annotations") + result = yield from self.await_lint_result(view) self.assertResult(result, expected) From 274fab81a3bfc12353def9fd2492a20ee08116a1 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 18:35:13 +0200 Subject: [PATCH 15/17] Move issue 33 test into normal end-to-end test --- tests/test_regex.py | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index cfba03b..d571233 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -64,29 +64,6 @@ def on_result(filename, linter_name, errors, **kwargs): class TestAnnotationsLinter(LintResultTestCase): linter_name = "annotations" - @p.expand( - [ - ( - "// NOTE(kaste): a note", - "scope:source.js", - [ - { - "line": 0, - "start": 3, - "msg": "(kaste): a note", - "error_type": "info", - } - ], - ) - ] - ) - def test_extract_author_issue_33( - self, view_content, syntax, expected - ): - view = self.prepare_view(view_content, syntax) - result = yield from self.await_lint_result(view) - self.assertResult(result, expected) - @p.expand( [ ( @@ -106,6 +83,18 @@ def test_extract_author_issue_33( ) for word in words ] + + [ + ( # extract author of a note #33 + "// NOTE(kaste): a note", + "scope:source.js", + { + "line": 0, + "start": 3, + "msg": "(kaste): a note", + "error_type": "info", + }, + ) + ] ) def test_end_to_end(self, view_content, syntax, expected): view = self.prepare_view(view_content, syntax) From 3e802d961b8c564824e1d41dbc89ef30d0ee5db4 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 22:27:07 +0200 Subject: [PATCH 16/17] Rename workflow file to `ci.yml` --- .github/workflows/{tests.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{tests.yml => ci.yml} (100%) diff --git a/.github/workflows/tests.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/tests.yml rename to .github/workflows/ci.yml From 2bfe93e5b498f5c5c7bea9fdc41228a4efc229d5 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Sun, 17 Jul 2022 22:40:50 +0200 Subject: [PATCH 17/17] Do not use the private `SublimeLinter.lint.util` module --- tests/test_regex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_regex.py b/tests/test_regex.py index d571233..75c80e7 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -2,7 +2,7 @@ from unittesting import DeferrableTestCase from SublimeLinter.tests.parameterized import parameterized as p -from SublimeLinter.lint import events, util +from SublimeLinter.lint import events, linter MYPY = False @@ -44,7 +44,7 @@ def await_lint_result(self, view, linter_name_=None): # type: (sublime.View, str) -> Generator[object, object, list[dict]] if linter_name_ is None: linter_name_ = self.linter_name - filename_ = util.get_filename(view) + filename_ = linter.get_view_context(view)["canonical_filename"] actual = None @events.on("LINT_RESULT")