Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
dashboards
Commits
efaafce37491
Commit
75e5b19f
authored
Nov 27, 2020
by
Laurent Peuch
Browse files
feat(deprecated): display if a warning originates from the code of the repository
parent
2fb33521e2b1
Pipeline
#23811
failed with stages
in 3 minutes and 21 seconds
Changes
3
Pipelines
171
Hide whitespace changes
Inline
Side-by-side
deprecated-warnings.py
View file @
efaafce3
...
...
@@ -204,6 +204,13 @@ for gitlab_project, warnings in all_artifacts.items():
if
warning_key
not
in
result
[
warning_text
][
"projects"
][
gitlab_project
][
"warnings"
]:
result
[
warning_text
][
"projects"
][
gitlab_project
][
"warnings"
][
warning_key
]
=
warning
try
:
gitlab_project
.
files
.
get
(
warning
[
"filename"
],
ref
=
"branch/default"
)
except
gitlab
.
exceptions
.
GitlabGetError
:
warning
[
"file_in_current_repo"
]
=
False
else
:
warning
[
"file_in_current_repo"
]
=
True
# this is done to display a summary of the warning at the top
if
warning
[
"category"
]
!=
"DeprecationWarning"
:
if
"test_file"
in
warning
and
"/site-packages/"
in
warning
[
"test_file"
]:
...
...
public/css/style.css
View file @
efaafce3
...
...
@@ -133,3 +133,12 @@ table.qa td.readthedocs a {
text-decoration
:
none
;
padding-top
:
300px
;
}
.alert-info
{
background-color
:
#D1ECF1
;
color
:
#0c5460
;
padding
:
.75rem
1.25rem
;
border
:
1px
solid
#bee5eb
;
border-radius
:
.25rem
;
margin-bottom
:
1rem
;
}
template/deprecated-warnings.html
View file @
efaafce3
...
...
@@ -69,6 +69,12 @@
{% if path in files_to_url %}(
<a
href=
"{{ files_to_url[path] }}#L{{ lineno }}"
target=
"_blank"
>
file on branch/default
</a>
){% endif %}
</p>
{% if warning["file_in_current_repo"] %}
<div
class=
"alert-info"
>
This warning originates from the source code of this respository
</div>
{% endif %}
{% if "file_content" in warning %}
{{ highlight_code(warning["file_content"], lineno) }}
{% endif %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment