Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scripts
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Specification Tools
Scripts
Commits
d2f882b3
Commit
d2f882b3
authored
1 year ago
by
Miguel Angel Reina Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Support for changes in clause headings
parent
64f60ad7
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#736
passed
1 year ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
generateChangemarks/changemarks.py
+29
-13
29 additions, 13 deletions
generateChangemarks/changemarks.py
generate_changemarks.sh
+1
-1
1 addition, 1 deletion
generate_changemarks.sh
with
30 additions
and
14 deletions
generateChangemarks/changemarks.py
+
29
−
13
View file @
d2f882b3
...
@@ -458,7 +458,10 @@ def find_clauses_with_changes(progress: Progress, mdLines_changes: list[Tuple[st
...
@@ -458,7 +458,10 @@ def find_clauses_with_changes(progress: Progress, mdLines_changes: list[Tuple[st
_taskID
=
progress
.
add_task
(
'
[blue]Find clauses with changes
'
,
start
=
False
,
total
=
0
)
_taskID
=
progress
.
add_task
(
'
[blue]Find clauses with changes
'
,
start
=
False
,
total
=
0
)
clauseregex
=
re
.
compile
(
'
^#+\s(\d+(\.\d+)*|Annex \w(\.\d+)*|\w*(\.\d+)*|~~#).*
'
)
clauseregex
=
re
.
compile
(
'
^#+\s(\d+(\.\d+)*|Annex \w(\.\d+)*|\w*(\.\d+)*).*
'
)
removedclauseregex
=
re
.
compile
(
'
^\~\~#+\s(\d+(\.\d+)*|Annex \w(\.\d+)*|\w+\s\w*(\.\d+)*).*
'
)
addedclauseregex
=
re
.
compile
(
'
^\<span\sclass\=
\"
underline
\"
\>#+\s(\d+(\.\d+)*|Annex \w(\.\d+)*|\w+\s\w*(\.\d+)*).*
'
)
clauses
:
list
[
Clause
]
=
[]
clauses
:
list
[
Clause
]
=
[]
changed_clauses
:
list
[
Clause
]
=
[]
changed_clauses
:
list
[
Clause
]
=
[]
changeInClause
=
False
changeInClause
=
False
...
@@ -473,24 +476,37 @@ def find_clauses_with_changes(progress: Progress, mdLines_changes: list[Tuple[st
...
@@ -473,24 +476,37 @@ def find_clauses_with_changes(progress: Progress, mdLines_changes: list[Tuple[st
# break
# break
# index = index + 1
# index = index + 1
index
=
1
def
checkClause
(
_matches
):
for
line
,
change
in
mdLines_changes
:
nonlocal
clause
if
change
:
nonlocal
changeInClause
changeInClause
=
True
if
line
.
startswith
(
'
#
'
):
matches
=
re
.
findall
(
clauseregex
,
line
)
# Match heading
if
matches
:
# It may be the end of the clause or the start of a subclause
if
index
-
2
==
clause
.
from_id
:
# It is a subclause
if
index
-
2
==
clause
.
from_id
:
# It is a subclause
clause
.
from_id
=
index
clause
.
from_id
=
index
clause
.
raw
=
line
clause
.
raw
=
line
clause
.
clause_nr
=
matches
[
0
][
0
]
clause
.
clause_nr
=
_
matches
[
0
][
0
]
else
:
# It is the end of the clause
else
:
# It is the end of the clause
clause
.
to_id
=
index
-
1
clause
.
to_id
=
index
-
1
clauses
.
append
(
clause
)
clauses
.
append
(
clause
)
if
changeInClause
:
if
changeInClause
:
changed_clauses
.
append
(
clause
)
changed_clauses
.
append
(
clause
)
clause
=
Clause
(
line
,
index
,
index
,
matches
[
0
][
0
])
clause
=
Clause
(
line
,
index
,
index
,
_
matches
[
0
][
0
])
changeInClause
=
False
changeInClause
=
False
index
=
1
for
line
,
change
in
mdLines_changes
:
if
change
:
changeInClause
=
True
if
line
.
startswith
(
'
#
'
)
or
line
.
startswith
(
"
~~#
"
)
or
line
.
startswith
(
"
<span class=
\"
underline
\"
>#
"
):
matches
=
re
.
findall
(
clauseregex
,
line
)
# Match heading
removedmatches
=
re
.
findall
(
removedclauseregex
,
line
)
# Match removed heading
addedmatches
=
re
.
findall
(
addedclauseregex
,
line
)
# Match removed heading
if
matches
:
# It may be the end of the clause or the start of a subclause
checkClause
(
matches
)
elif
removedmatches
:
checkClause
(
removedmatches
)
elif
addedmatches
:
checkClause
(
addedmatches
)
else
:
# it is last clause
else
:
# it is last clause
print
(
"
Unknown heading
"
)
print
(
"
Unknown heading
"
)
...
...
This diff is collapsed.
Click to expand it.
generate_changemarks.sh
+
1
−
1
View file @
d2f882b3
#!/bin/bash
#!/bin/bash
FORGELIB_DOCKER_IMAGE
=
forge.3gpp.org:5050/tools/3gpp-scripts/forgelib:v2.1
1
.0
FORGELIB_DOCKER_IMAGE
=
forge.3gpp.org:5050/tools/3gpp-scripts/forgelib:v2.1
3
.0
GENERATE_CHANGEMARKS_DOCKER_IMAGE
=
generatechangemarks:master
GENERATE_CHANGEMARKS_DOCKER_IMAGE
=
generatechangemarks:master
DOCKER_IMAGE
=
pandoc/core:3.1.1.0
DOCKER_IMAGE
=
pandoc/core:3.1.1.0
...
...
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