Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cube-doctor
Commits
cb2809601e77
Commit
5cd398ff
authored
Apr 21, 2021
by
Laurent Peuch
Browse files
fix(cube-licence-date): handle parsing error
parent
2798704136d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
cube_doctor/transforms/update_cube_licence_dates.py
View file @
cb280960
import
re
import
baron
from
datetime
import
date
from
redbaron
import
RedBaron
...
...
@@ -31,7 +32,12 @@ class UpdateCubeLicenceDates(Command):
old_licence
=
f
"# copyright
{
match
[
'start'
]
}
LOGILAB S.A."
new_licence
=
f
"# copyright
{
match
[
'start'
]
}
-
{
today_year
}
LOGILAB S.A."
red
=
RedBaron
(
file_content_before
)
try
:
red
=
RedBaron
(
file_content_before
)
except
baron
.
parser
.
ParsingError
:
# eh
continue
for
target
in
red
(
"comment"
,
lambda
x
:
x
.
value
.
startswith
(
old_licence
)):
target
.
value
=
target
.
value
.
replace
(
old_licence
,
new_licence
)
...
...
Write
Preview
Supports
Markdown
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