Conversation
|
🍱 Your pull request preview is ready Please use this preview to check your changes. Ideally use the test documentation template and document your test results by commenting on the PR. This will speed up the review process for everyone. FYI, once this PR is merged, you can use the iD Editor Preview to test your changes in interaction with all other changes. |
| "café", | ||
| "caffe", | ||
| "caffè", | ||
| "café", |
There was a problem hiding this comment.
This might be controversial: this is now sorted on UTF-16 code units order (which can easily be checked programmatically), but the previous sort order definitely makes sense, too.
| "doner kebab", | ||
| "döner kebab", | ||
| "drive-in", | ||
| "döner kebab", |
| "water closet", | ||
| "WC", | ||
| "W.C." | ||
| "wc" |
| "r&d", | ||
| "r & d", | ||
| "r and d", | ||
| "r&d", |
| "W.C." | ||
| "public toilet", | ||
| "w.c.", | ||
| "wc" |
| "gym", | ||
| "pullup", | ||
| "pull up", | ||
| "pullup", |
| "monkey bars", | ||
| "pullup", | ||
| "pull up", | ||
| "pullup", |
| "gym", | ||
| "pushup", | ||
| "push up", | ||
| "pushup", |
| "muscle up", | ||
| "pullup", | ||
| "pull up", | ||
| "pullup", |
| "gym", | ||
| "situp", | ||
| "sit up", | ||
| "situp", |
|
@FloEdelmann do you have still code that did this rewrite? It would be useful for #874 (comment) and #1813 |
|
For reference, this was the code to generate these changes: scripts/sort-terms.js#!/usr/bin/env zx
// NOTE: uses https://github.com/google/zx and has to be called from id-tagging-schema root directory
const presetJsonFiles = await glob('./data/presets/**/*.json', {
gitignore: true,
absolute: true,
})
for (const file of presetJsonFiles) {
const preset = JSON.parse(fs.readFileSync(file, 'utf-8'))
const terms = preset.terms
if (!terms) {
continue
}
const expectedTerms = terms.map(term => term.toLowerCase()).sort()
if (terms.every((term, index) => expectedTerms[index] === term)) {
continue
}
console.log(file)
console.log(terms, expectedTerms)
preset.terms = expectedTerms
fs.writeFileSync(file, JSON.stringify(preset, null, 4) + '\n', 'utf8')
}It assumes that Node.js v22+ and https://github.com/google/zx are available. |
Description, Motivation & Context
As mentioned in the guidelines, terms should be lowercase and sorted A-Z. This PR standardizes all presets to follow this format.
As requested in #1753 (comment), I opened one big PR to fix them all (440 presets!), so a check can be introduced to the build scripts that would alert if the order is mixed up.
I split up the changes over at least one commit per directory (for bigger directories: one commit per subdirectory) to make it easy to rebase and fix individual merge conflicts, should this be required.
Related issues
Follow-up to #1753.
Links and data
Relevant OSM Wiki links: –
Relevant tag usage stats: –
Checklist and Test-Documentation Template
Read on to get your PR merged faster…
Follow these steps to test your PR yourself and make it a lot easier and faster for maintainers to check and approve it.
This is how it works:
After you submit your PR, the system will create a preview and comment on your PR:
Once the preview is ready, use it to test your changes.
Now copy the snippet below into a new comment and fill out the blanks.
Now your PR is ready to be reviewed.