Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
codeaster-fra
devtools
Commits
a20d8561
Commit
a20d8561
authored
1 month ago
by
Mathieu Courtois
Browse files
Options
Downloads
Patches
Plain Diff
[#34298] utmess and message id must be on the same line to be checked
parent
9ecb0f41
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/aslint/python/python_checkers.py
+22
-0
22 additions, 0 deletions
lib/aslint/python/python_checkers.py
with
22 additions
and
0 deletions
lib/aslint/python/python_checkers.py
+
22
−
0
View file @
a20d8561
...
...
@@ -198,12 +198,34 @@ class ObsoleteSdj(FileContentCat, TextMsg):
apply_ctxt
=
CheckContext
(
reponame
=
[
"
src
"
],
branch
=
"
main
"
)
search
=
search_msg
(
r
"
(?P<main>\w+\.sdj(?:\.\w+)?)
"
,
ignore_case
=
False
)
class
ObsoleteGetvectjev
(
FileContentCat
,
TextMsg
):
"""
Obsolete use of getvectjev or getcolljev
"""
id
=
"
C4015
"
search
=
search_msg
(
r
"
(?P<main>(getvectjev|getcolljev))
"
,
ignore_case
=
False
)
class
MultiLinesUtmess
(
FileContentCat
,
GenericMsg
):
"""
Message id not found on the same line (use a dict for args)
"""
id
=
"
C4501
"
def
search
(
self
,
txt
):
"""
Check for UTMESS without message id
"""
if
"
def format_exception
"
in
txt
:
return
[]
if
"
class MESSAGE_LOGGER
"
in
txt
:
return
[]
re_utm
=
re
.
compile
(
r
"
(?P<line>(?:UTMESS|GetText|message_exception)\s*\(.*)
"
,
re
.
M
)
re_id
=
re
.
compile
(
r
"
(UTMESS|GetText|message_exception)\s*\(.*_
"
,
re
.
I
)
err
=
[]
for
mat
in
re_utm
.
finditer
(
txt
):
if
not
re_id
.
search
(
mat
.
group
(
"
line
"
)):
err
.
append
(
f
"
:
{
mat
.
group
(
'
line
'
)
}
"
)
return
err
class
ReformatSource
(
FilenameCat
,
COMM
.
ReformatPy
):
"""
Reformat Python source
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment