Skip to content

Commit a38eeca

Browse files
srl295AEApple
andauthored
CLDR-18209 spec: require modifications section to be updated (#5122)
Co-authored-by: Annemarie Apple <[email protected]>
1 parent 74ff3a5 commit a38eeca

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

.github/workflows/maven.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ jobs:
6060
output: linkcheck.md
6161
- name: Link Checker Summary PathDescriptions.md
6262
run: cat linkcheck.md >> $GITHUB_STEP_SUMMARY
63+
- name: 'spec: Check that tr35-modifications.md was updated'
64+
if: github.event_name == 'pull_request'
65+
run: bash tools/scripts/tr-archive/check-mod-section.sh HEAD origin/${{ github.base_ref }}
6366
package:
6467
name: "Package up CLDR"
6568
runs-on: ubuntu-latest

docs/ldml/tr35-modifications.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ The LDML specification is divided into the following parts:
6161

6262
## Modifications
6363

64+
<!--
65+
Note: As of CLDR-18209, ALL changes to the spec require this file, tr35-modifications.md to be modified as well. If you are making a change that doesn't need to be noted, or is already noted, please simply add an HTML comment (such as this one) to the appropriate section. The comment will not be visible to viewers of the HTML page.
66+
-->
67+
6468
**Changes in LDML Version 48 (Differences from Version 47)**
6569

6670
### Locale Identifiers and Names
@@ -70,7 +74,7 @@ Also revamped the description of how to construct names for locale IDs, for clar
7074
* [Likely Subtags](tr35.md#likely-subtags) Changed the Canonicalize step to point to the section on canonicalization.
7175
* [Unicode Locale Identifier](tr35.md#unicode-locale-identifier) Changed the `attribute` component in the EBNF to be `uattribute` for consistency with `ufield`, etc.
7276
and to reduce confusion with XML attributes.
73-
77+
7478
### Misc.
7579
* [Character Elements](tr35-general.md#character-elements) Added new exemplar types.
7680
* [DTD Annotations](tr35.md#dtd_annotations) Added the @CDATA annotation, to indicate which elements are generated with @CDATA format
@@ -106,7 +110,7 @@ The rules have been converted to a “flat” format, which is easier for client
106110

107111
### MessageFormat
108112
* Syntax and data model errors must now be prioritized over other errors <!-- ([\#1011](https://github.com/unicode-org/message-format-wg/pull/1011)) -->
109-
* The Default Bidi Strategy is now required and default <!-- ([\#1066](https://github.com/unicode-org/message-format-wg/pull/1066)) -->
113+
* The Default Bidi Strategy is now required and default <!-- ([\#1066](https://github.com/unicode-org/message-format-wg/pull/1066)) -->
110114
* The `:offset` function (previously named `:math`) is now available as Stable <!-- ([\#1073](https://github.com/unicode-org/message-format-wg/pull/1073)) -->
111115
* The `:datetime`, `:date`, and `:time` _draft_ functions are updated to build on top of semantic skeletons <!-- ([\#1078](https://github.com/unicode-org/message-format-wg/pull/1078), [\#1083](https://github.com/unicode-org/message-format-wg/pull/1083)) -->
112116
* `:percent` is added as a new _draft_ function <!-- ([\#1094](https://github.com/unicode-org/message-format-wg/pull/1094)) -->
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
function msg() {
4+
if [[ ! -z "${GITHUB_STEP_SUMMARY}" ]];
5+
then
6+
echo "$@" >> "${GITHUB_STEP_SUMMARY}"
7+
fi
8+
echo "% $@"
9+
}
10+
11+
12+
if [[ $# -ne 2 ]];
13+
then
14+
msg "X Internal Error"
15+
echo >&2 "Error: usage: $0 ref1 ref2"
16+
exit 1
17+
fi
18+
19+
CHANGED=$(git diff --name-status $1 $2 | grep '^[MA]' | cut -c2- | fgrep 'docs/ldml/tr35-')
20+
21+
if [[ -z "${CHANGED}" ]];
22+
then
23+
msg "∅ No spec changes."
24+
exit 0
25+
fi
26+
27+
function list_changed() {
28+
msg ""
29+
msg "## List of changes:"
30+
for file in ${CHANGED}; do
31+
msg "- ${file}"
32+
done
33+
msg ""
34+
}
35+
36+
if echo "${CHANGED}" | fgrep -s '/tr35-modifications.md';
37+
then
38+
msg "✅ Spec changes: tr35-modifications.md was updated"
39+
list_changed
40+
exit 0
41+
else
42+
msg "⚠️ Spec changes but tr35-modifications.md section was not updated!"
43+
msg "For non-substantive changes that do not require an item in modifications such as fixing typos, add an HTML comment such as:"
44+
msg ""
45+
msg " <!-- updated whitespace -->"
46+
msg ""
47+
msg "to the file."
48+
list_changed
49+
exit 1
50+
fi

0 commit comments

Comments
 (0)