Skip to content

Commit 0b17a2d

Browse files
nejchJohnVillalovos
authored andcommitted
refactor(lint): remove deprecated lint()in favor of ci_lint.create()
BREAKING CHANGE: The deprecated `lint()` method is no longer available. Use `ci_lint.create()` instead.
1 parent 90134c9 commit 0b17a2d

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

gitlab/client.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -402,32 +402,6 @@ def version(self) -> Tuple[str, str]:
402402

403403
return cast(str, self._server_version), cast(str, self._server_revision)
404404

405-
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabVerifyError)
406-
def lint(self, content: str, **kwargs: Any) -> Tuple[bool, List[str]]:
407-
"""Validate a gitlab CI configuration.
408-
409-
Args:
410-
content: The .gitlab-ci.yml content
411-
**kwargs: Extra options to send to the server (e.g. sudo)
412-
413-
Raises:
414-
GitlabAuthenticationError: If authentication is not correct
415-
GitlabVerifyError: If the validation could not be done
416-
417-
Returns:
418-
(True, []) if the file is valid, (False, errors(list)) otherwise
419-
"""
420-
utils.warn(
421-
"`lint()` is deprecated and will be removed in a future version.\n"
422-
"Please use `ci_lint.create()` instead.",
423-
category=DeprecationWarning,
424-
)
425-
post_data = {"content": content}
426-
data = self.http_post("/ci/lint", post_data=post_data, **kwargs)
427-
if TYPE_CHECKING:
428-
assert not isinstance(data, requests.Response)
429-
return (data["status"] == "valid", data["errors"])
430-
431405
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabMarkdownError)
432406
def markdown(
433407
self, text: str, gfm: bool = False, project: Optional[str] = None, **kwargs: Any

tests/functional/api/test_gitlab.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ def test_markdown_in_project(gl, project):
6666
assert "foo" in html
6767

6868

69-
def test_lint(gl):
70-
with pytest.deprecated_call():
71-
success, errors = gl.lint("Invalid")
72-
assert success is False
73-
assert errors
74-
75-
7669
def test_sidekiq_queue_metrics(gl):
7770
out = gl.sidekiq.queue_metrics()
7871
assert isinstance(out, dict)

0 commit comments

Comments
 (0)