diff --git a/.travis.yml b/.travis.yml index 7e66e0c1f..3878a1415 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,7 @@ matrix: - ./scripts/check_taginfo.py taginfo.json profiles/car.lua - ${MASON} install clang-format 3.8.1 - PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh + - node ./scripts/validate_changelog.js # See issue 4043 #- npm run docs && ./scripts/error_on_dirty.sh after_success: diff --git a/CHANGELOG.md b/CHANGELOG.md index afbe49275..06bda83ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,25 @@ # UNRELEASED - Changes from 5.16.0: - Bugfixes: - - fix deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909) - - FIXED #4920: Use smaller range for U-turn angles in map-matching [#4920](https://github.com/Project-OSRM/osrm-backend/pull/4920) - - FIXED: Remove the last short annotation segment in `trimShortSegments` + - FIXED: deduplication of route steps when waypoints are used [#4909](https://github.com/Project-OSRM/osrm-backend/issues/4909) + - FIXED: Use smaller range for U-turn angles in map-matching [#4920](https://github.com/Project-OSRM/osrm-backend/pull/4920) + - FIXED: Remove the last short annotation segment in `trimShortSegments` [#4946](https://github.com/Project-OSRM/osrm-backend/pull/4946) - FIXED: Properly calculate annotations for speeds, durations and distances when waypoints are used with mapmatching [#4949](https://github.com/Project-OSRM/osrm-backend/pull/4949) - Profile: - - CHANGED #4929: Handle oneways in get_forward_backward_by_key [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929) - - FIXED #4943: Do not route against oneway road if there is a cycleway in the wrong direction; also review bike profile [#4943](https://github.com/Project-OSRM/osrm-backend/issues/4943) + - CHANGED: Handle oneways in get_forward_backward_by_key [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929) + - FIXED: Do not route against oneway road if there is a cycleway in the wrong direction; also review bike profile [#4943](https://github.com/Project-OSRM/osrm-backend/issues/4943) - Guidance: - - CHANGED #4929: Don't use obviousness for links bifurcations [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929) - - FIXED #4929: Adjust Straight direction modifiers of side roads in driveway handler [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929) - - CHANGED #4925: Added post process logic to collapse segregated turn instructions [#4925](https://github.com/Project-OSRM/osrm-backend/pull/4925) + - CHANGED: Don't use obviousness for links bifurcations [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929) + - FIXED: Adjust Straight direction modifiers of side roads in driveway handler [#4929](https://github.com/Project-OSRM/osrm-backend/pull/4929) + - CHANGED: Added post process logic to collapse segregated turn instructions [#4925](https://github.com/Project-OSRM/osrm-backend/pull/4925) - ADDED: Maneuver relation now supports `straight` as a direction [#4995](https://github.com/Project-OSRM/osrm-backend/pull/4995) - Tools: - - `osrm-routed` accepts a new property `--memory_file` to store memory in a file on disk. + - ADDED: `osrm-routed` accepts a new property `--memory_file` to store memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881) - NodeJS: - - `OSRM` object accepts a new option `memory_file` that stores the memory in a file on disk. + - ADDED: `OSRM` object accepts a new option `memory_file` that stores the memory in a file on disk. [#4881](https://github.com/Project-OSRM/osrm-backend/pull/4881) - Internals - - CHANGED #4845 #4968: Updated segregated intersection identification [#4845](https://github.com/Project-OSRM/osrm-backend/pull/4845) [#4968](https://github.com/Project-OSRM/osrm-backend/pull/4968) - - REMOVED: Remove `.timestamp` file since it was unused. + - CHANGED: Updated segregated intersection identification [#4845](https://github.com/Project-OSRM/osrm-backend/pull/4845) [#4968](https://github.com/Project-OSRM/osrm-backend/pull/4968) + - REMOVED: Remove `.timestamp` file since it was unused [#4960](https://github.com/Project-OSRM/osrm-backend/pull/4960) - Documentation: - ADDED: Add documentation about OSM node ids in nearest service response [#4436](https://github.com/Project-OSRM/osrm-backend/pull/4436) - Performance diff --git a/scripts/validate_changelog.js b/scripts/validate_changelog.js new file mode 100644 index 000000000..f205c1a0e --- /dev/null +++ b/scripts/validate_changelog.js @@ -0,0 +1,46 @@ +var linereader = require('readline').createInterface( { + input: require('fs').createReadStream(require('path').join(__dirname, '..', 'CHANGELOG.md')) +}); + +var done = false; +var linenum = 0; +var has_errors = false; +linereader.on('line', function(line) { + linenum += 1; + // Only validate the `# UNRELEASED` section + if (line.match(/^# [^U]/)) done = true; + if (done) return; + + var line_errors = []; + + if (line.match(/^ {6}/)) { + if (!line.match(/^ {6}- (ADDED|FIXED|CHANGED|REMOVED): /)) { + line_errors.push("ERROR: changelog entries must start with '- (ADDED|FIXED|CHANGED|REMOVED): '"); + } + if (!line.match(/\[#[0-9]+\]\(http.*\)$/)) { + line_errors.push("ERROR: changelog entries must end with an issue or PR link in Markdown format"); + } + } + + if (line_errors.length > 0) { + has_errors = true; + + // Coloured output if it's directly on an interactive terminal + if (process.stdout.isTTY) { + console.log('\x1b[31mERROR ON LINE %d\x1b[0m: %s', linenum, line); + for (var i = 0; i