From 192bea800e85a5e18765d1237d29cc57489a4874 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 1 Sep 2021 14:10:04 +0200 Subject: [PATCH 1/4] pre-commit: Add changelog hook that adds missing links --- .pre-commit-config.yaml | 7 +++++++ tools/changelog.py | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 tools/changelog.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5c82b23c677..893beb310c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -115,3 +115,10 @@ repos: stages: - commit - manual + - id: changelog + name: changelog + description: Add missing links to changelog. + entry: ./tools/changelog.py + language: python + types: [text] + files: ^CHANGELOG.md$ diff --git a/tools/changelog.py b/tools/changelog.py new file mode 100755 index 00000000000..f062189967f --- /dev/null +++ b/tools/changelog.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +import argparse +import re + + +def add_missing_links(changelog): + """Ensure that all the changelog conforms to our common format.""" + # Ensure that all launchpad issues are hyperlinks + changelog = re.sub( + r"(?!\[)\blp:?(?P\d+)\b(?!\])", + r"[lp:\g](https://bugs.launchpad.net/mixxx/+bug/\g)", + changelog, + ) + + # Ensure that all GitHub PRs are hyperlinks + changelog = re.sub( + r"(?!\[)#\b(?P\d+)\b(?!\])", + r"[#\g](https://github.com/mixxxdj/mixxx/pull/\g)", + changelog, + ) + + return changelog + + +def main(argv=None): + parser = argparse.ArgumentParser() + parser.add_argument("file", type=argparse.FileType("r+")) + args = parser.parse_args(argv) + + # Fetch changelog and convert to RST + changelog = args.file.read() + fixed_changelog = add_missing_links(changelog) + if changelog != fixed_changelog: + args.file.seek(0) + args.file.write(fixed_changelog) + args.file.truncate() + args.file.close() + + +if __name__ == "__main__": + main() From f7af5803d794d4b34279d2b9ac54d7daaf1b8c0e Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 1 Sep 2021 14:11:07 +0200 Subject: [PATCH 2/4] CHANGELOG: Add missing links --- CHANGELOG.md | 124 +++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de20f20cc79..31a2b65a01b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,75 +155,75 @@ ## [2.2.4](https://launchpad.net/mixxx/+milestone/2.2.4) (2020-06-27) -* Store default recording format after "Restore Defaults" lp:1857806 #2414 -* Prevent infinite loop when decoding corrupt MP3 files #2417 -* Add workaround for broken libshout versions #2040 #2438 -* Speed up purging of tracks lp:1845837 #2393 -* Don't stop playback if vinyl passthrough input is configured and PASS button is pressed #2474 -* Fix debug assertion for invalid crate names lp:1861431 #2477 -* Fix crashes when executing actions on tracks that already disappeared from the DB #2527 -* AutoDJ: Skip next track when both deck are playing lp:1399974 #2531 -* Tweak scratch parameters for Mixtrack Platinum #2028 -* Fix auto tempo going to infinity on Pioneer DDJ-SB2 #2559 -* Fix bpm.tapButton logic and reject missed & double taps #2594 -* Add controller mapping for Native Instruments Traktor Kontrol S2 MK3 #2348 -* Add controller mapping for Soundless joyMIDI #2425 -* Add controller mapping for Hercules DJControl Inpulse 300 #2465 -* Add controller mapping for Denon MC7000 #2546 -* Add controller mapping for Stanton DJC.4 #2607 -* Fix broadcasting via broadcast/recording input lp:1876222 #2743 -* Only apply ducking gain in manual ducking mode when talkover is enabed lp:1394968 lp:1737113 lp:1662536 #2759 -* Ignore MIDI Clock Messages (0xF8) because they are not usable in Mixxx and inhibited the screensaver #2786 +* Store default recording format after "Restore Defaults" [lp:1857806](https://bugs.launchpad.net/mixxx/+bug/1857806) [#2414](https://github.com/mixxxdj/mixxx/pull/2414) +* Prevent infinite loop when decoding corrupt MP3 files [#2417](https://github.com/mixxxdj/mixxx/pull/2417) +* Add workaround for broken libshout versions [#2040](https://github.com/mixxxdj/mixxx/pull/2040) [#2438](https://github.com/mixxxdj/mixxx/pull/2438) +* Speed up purging of tracks [lp:1845837](https://bugs.launchpad.net/mixxx/+bug/1845837) [#2393](https://github.com/mixxxdj/mixxx/pull/2393) +* Don't stop playback if vinyl passthrough input is configured and PASS button is pressed [#2474](https://github.com/mixxxdj/mixxx/pull/2474) +* Fix debug assertion for invalid crate names [lp:1861431](https://bugs.launchpad.net/mixxx/+bug/1861431) [#2477](https://github.com/mixxxdj/mixxx/pull/2477) +* Fix crashes when executing actions on tracks that already disappeared from the DB [#2527](https://github.com/mixxxdj/mixxx/pull/2527) +* AutoDJ: Skip next track when both deck are playing [lp:1399974](https://bugs.launchpad.net/mixxx/+bug/1399974) [#2531](https://github.com/mixxxdj/mixxx/pull/2531) +* Tweak scratch parameters for Mixtrack Platinum [#2028](https://github.com/mixxxdj/mixxx/pull/2028) +* Fix auto tempo going to infinity on Pioneer DDJ-SB2 [#2559](https://github.com/mixxxdj/mixxx/pull/2559) +* Fix bpm.tapButton logic and reject missed & double taps [#2594](https://github.com/mixxxdj/mixxx/pull/2594) +* Add controller mapping for Native Instruments Traktor Kontrol S2 MK3 [#2348](https://github.com/mixxxdj/mixxx/pull/2348) +* Add controller mapping for Soundless joyMIDI [#2425](https://github.com/mixxxdj/mixxx/pull/2425) +* Add controller mapping for Hercules DJControl Inpulse 300 [#2465](https://github.com/mixxxdj/mixxx/pull/2465) +* Add controller mapping for Denon MC7000 [#2546](https://github.com/mixxxdj/mixxx/pull/2546) +* Add controller mapping for Stanton DJC.4 [#2607](https://github.com/mixxxdj/mixxx/pull/2607) +* Fix broadcasting via broadcast/recording input [lp:1876222](https://bugs.launchpad.net/mixxx/+bug/1876222) [#2743](https://github.com/mixxxdj/mixxx/pull/2743) +* Only apply ducking gain in manual ducking mode when talkover is enabed [lp:1394968](https://bugs.launchpad.net/mixxx/+bug/1394968) [lp:1737113](https://bugs.launchpad.net/mixxx/+bug/1737113) [lp:1662536](https://bugs.launchpad.net/mixxx/+bug/1662536) [#2759](https://github.com/mixxxdj/mixxx/pull/2759) +* Ignore MIDI Clock Messages (0xF8) because they are not usable in Mixxx and inhibited the screensaver [#2786](https://github.com/mixxxdj/mixxx/pull/2786) ## [2.2.3](https://launchpad.net/mixxx/+milestone/2.2.3) (2019-11-24) -* Don't make users reconfigure sound hardware when it has not changed #2253 -* Fix MusicBrainz metadata lookup [lp:1848887](https://bugs.launchpad.net/mixxx/+bug/1848887) #2328 -* Fix high DPI scaling of cover art #2247 -* Fix high DPI scaling of cue point labels on scrolling waveforms #2331 -* Fix high DPI scaling of sliders in Tango skin #2318 -* Fix sound dropping out during recording [lp:1842679](https://bugs.launchpad.net/mixxx/+bug/1842679) #2265 #2305 #2308 #2309 -* Fix rare crash on application shutdown #2293 -* Workaround various rare bugs caused by database inconsistencies [lp:1846971](https://bugs.launchpad.net/mixxx/+bug/1846971) #2321 -* Improve handling of corrupt FLAC files #2315 -* Don't immediately jump to loop start when loop_out is pressed in quantized mode [lp:1837077](https://bugs.launchpad.net/mixxx/+bug/1837077) #2269 -* Preserve order of tracks when dragging and dropping from AutoDJ to playlist [lp:1829601](https://bugs.launchpad.net/mixxx/+bug/1829601) #2237 -* Explicitly use X11 Qt platform plugin instead of Wayland in .desktop launcher [lp:1850729](https://bugs.launchpad.net/mixxx/+bug/1850729) #2340 -* Pioneer DDJ-SX: fix delayed sending of MIDI messages with low audio buffer sizes #2326 -* Enable modplug support on Linux by default [lp:1840537](https://bugs.launchpad.net/mixxx/+bug/1840537) #2244 #2272 -* Fix keyboard shortcut for View > Skin Preferences [lp:1851993](https://bugs.launchpad.net/mixxx/+bug/1851993) #2358 #2372 -* Reloop Terminal Mix: Fix mapping of sampler buttons 5-8 [lp:1846966](https://bugs.launchpad.net/mixxx/+bug/1846966) #2330 +* Don't make users reconfigure sound hardware when it has not changed [#2253](https://github.com/mixxxdj/mixxx/pull/2253) +* Fix MusicBrainz metadata lookup [lp:1848887](https://bugs.launchpad.net/mixxx/+bug/1848887) [#2328](https://github.com/mixxxdj/mixxx/pull/2328) +* Fix high DPI scaling of cover art [#2247](https://github.com/mixxxdj/mixxx/pull/2247) +* Fix high DPI scaling of cue point labels on scrolling waveforms [#2331](https://github.com/mixxxdj/mixxx/pull/2331) +* Fix high DPI scaling of sliders in Tango skin [#2318](https://github.com/mixxxdj/mixxx/pull/2318) +* Fix sound dropping out during recording [lp:1842679](https://bugs.launchpad.net/mixxx/+bug/1842679) [#2265](https://github.com/mixxxdj/mixxx/pull/2265) [#2305](https://github.com/mixxxdj/mixxx/pull/2305) [#2308](https://github.com/mixxxdj/mixxx/pull/2308) [#2309](https://github.com/mixxxdj/mixxx/pull/2309) +* Fix rare crash on application shutdown [#2293](https://github.com/mixxxdj/mixxx/pull/2293) +* Workaround various rare bugs caused by database inconsistencies [lp:1846971](https://bugs.launchpad.net/mixxx/+bug/1846971) [#2321](https://github.com/mixxxdj/mixxx/pull/2321) +* Improve handling of corrupt FLAC files [#2315](https://github.com/mixxxdj/mixxx/pull/2315) +* Don't immediately jump to loop start when loop_out is pressed in quantized mode [lp:1837077](https://bugs.launchpad.net/mixxx/+bug/1837077) [#2269](https://github.com/mixxxdj/mixxx/pull/2269) +* Preserve order of tracks when dragging and dropping from AutoDJ to playlist [lp:1829601](https://bugs.launchpad.net/mixxx/+bug/1829601) [#2237](https://github.com/mixxxdj/mixxx/pull/2237) +* Explicitly use X11 Qt platform plugin instead of Wayland in .desktop launcher [lp:1850729](https://bugs.launchpad.net/mixxx/+bug/1850729) [#2340](https://github.com/mixxxdj/mixxx/pull/2340) +* Pioneer DDJ-SX: fix delayed sending of MIDI messages with low audio buffer sizes [#2326](https://github.com/mixxxdj/mixxx/pull/2326) +* Enable modplug support on Linux by default [lp:1840537](https://bugs.launchpad.net/mixxx/+bug/1840537) [#2244](https://github.com/mixxxdj/mixxx/pull/2244) [#2272](https://github.com/mixxxdj/mixxx/pull/2272) +* Fix keyboard shortcut for View > Skin Preferences [lp:1851993](https://bugs.launchpad.net/mixxx/+bug/1851993) [#2358](https://github.com/mixxxdj/mixxx/pull/2358) [#2372](https://github.com/mixxxdj/mixxx/pull/2372) +* Reloop Terminal Mix: Fix mapping of sampler buttons 5-8 [lp:1846966](https://bugs.launchpad.net/mixxx/+bug/1846966) [#2330](https://github.com/mixxxdj/mixxx/pull/2330) ## [2.2.2](https://launchpad.net/mixxx/+milestone/2.2.2) (2019-08-10) -* Fix battery widget with upower <= 0.99.7. #2221 -* Fix BPM adjust in BpmControl. lp:1836480 -* Disable track metadata export for .ogg files and TagLib 1.11.1. lp:1833190 -* Fix interaction of hot cue buttons and looping. lp:1778246 -* Fix detection of moved tracks. #2197 -* Fix playlist import. lp:16878282 -* Fix updating playlist labels. lp:1837315 -* Fix potential segfault on exit. lp:1828360 -* Fix parsing of invalid bpm values in MP3 files. lp:1832325 -* Fix crash when removing rows from empty model. #2128 -* Fix high DPI scaling of RGB overview waveforms. #2090 -* Fix for OpenGL SL detection on macOS. lp:1828019 -* Fix OpenGL ES detection. lp:1825461 -* Fix FX1/2 buttons missing Mic unit in Deere (64 samplers). lp:1837716 -* Tango64: Re-enable 64 samplers. #2223 -* Numark DJ2Go re-enable note-off for deck A cue button. #2087 -* Replace Flanger with QuickEffect in keyboard mapping. #2233 +* Fix battery widget with upower <= 0.99.7. [#2221](https://github.com/mixxxdj/mixxx/pull/2221) +* Fix BPM adjust in BpmControl. [lp:1836480](https://bugs.launchpad.net/mixxx/+bug/1836480) +* Disable track metadata export for .ogg files and TagLib 1.11.1. [lp:1833190](https://bugs.launchpad.net/mixxx/+bug/1833190) +* Fix interaction of hot cue buttons and looping. [lp:1778246](https://bugs.launchpad.net/mixxx/+bug/1778246) +* Fix detection of moved tracks. [#2197](https://github.com/mixxxdj/mixxx/pull/2197) +* Fix playlist import. [lp:16878282](https://bugs.launchpad.net/mixxx/+bug/16878282) +* Fix updating playlist labels. [lp:1837315](https://bugs.launchpad.net/mixxx/+bug/1837315) +* Fix potential segfault on exit. [lp:1828360](https://bugs.launchpad.net/mixxx/+bug/1828360) +* Fix parsing of invalid bpm values in MP3 files. [lp:1832325](https://bugs.launchpad.net/mixxx/+bug/1832325) +* Fix crash when removing rows from empty model. [#2128](https://github.com/mixxxdj/mixxx/pull/2128) +* Fix high DPI scaling of RGB overview waveforms. [#2090](https://github.com/mixxxdj/mixxx/pull/2090) +* Fix for OpenGL SL detection on macOS. [lp:1828019](https://bugs.launchpad.net/mixxx/+bug/1828019) +* Fix OpenGL ES detection. [lp:1825461](https://bugs.launchpad.net/mixxx/+bug/1825461) +* Fix FX1/2 buttons missing Mic unit in Deere (64 samplers). [lp:1837716](https://bugs.launchpad.net/mixxx/+bug/1837716) +* Tango64: Re-enable 64 samplers. [#2223](https://github.com/mixxxdj/mixxx/pull/2223) +* Numark DJ2Go re-enable note-off for deck A cue button. [#2087](https://github.com/mixxxdj/mixxx/pull/2087) +* Replace Flanger with QuickEffect in keyboard mapping. [#2233](https://github.com/mixxxdj/mixxx/pull/2233) ## [2.2.1](https://launchpad.net/mixxx/+milestone/2.2.1) (2019-04-22) * Include all fixes from Mixxx 2.1.7 and 2.1.8 -* Fix high CPU usage on MAC due to preview column lp:1812763 +* Fix high CPU usage on MAC due to preview column [lp:1812763](https://bugs.launchpad.net/mixxx/+bug/1812763) * Fix HID controller output on Windows with common-hid-packet-parser.js -* Fix rendering slow down by not using QStylePainter in WSpinny lp:1530720 -* Fix broken Mic mute button lp:1782568 +* Fix rendering slow down by not using QStylePainter in WSpinny [lp:1530720](https://bugs.launchpad.net/mixxx/+bug/1530720) +* Fix broken Mic mute button [lp:1782568](https://bugs.launchpad.net/mixxx/+bug/1782568) * added quick effect enable button to the control picker menu * Fix Cover Window close issue with empty cover arts -* Fix Numark Mixtrack 3 mapping. #2057 +* Fix Numark Mixtrack 3 mapping. [#2057](https://github.com/mixxxdj/mixxx/pull/2057) ## [2.2.0](https://launchpad.net/mixxx/+milestone/2.2.0) (2018-12-17) @@ -264,12 +264,12 @@ ## [2.1.8](https://launchpad.net/mixxx/+milestone/2.1.8) (2019-04-07) -* Fix a rare chance for a corrupt track file while writing metadata in out of disk situations. lp:1815305 -* Fix export of BPM track file metadata. lp:1816490 -* Fix export of BPM track file metadata. lp:1816490 -* Fix sending of broadcast metadata with TLS enabled libshout 2.4.1. lp:1817395 -* Fix resdicovering purged tracks in all cases. lp:1821514 -* Fix dropping track from OSX Finder. lp:1822424 +* Fix a rare chance for a corrupt track file while writing metadata in out of disk situations. [lp:1815305](https://bugs.launchpad.net/mixxx/+bug/1815305) +* Fix export of BPM track file metadata. [lp:1816490](https://bugs.launchpad.net/mixxx/+bug/1816490) +* Fix export of BPM track file metadata. [lp:1816490](https://bugs.launchpad.net/mixxx/+bug/1816490) +* Fix sending of broadcast metadata with TLS enabled libshout 2.4.1. [lp:1817395](https://bugs.launchpad.net/mixxx/+bug/1817395) +* Fix resdicovering purged tracks in all cases. [lp:1821514](https://bugs.launchpad.net/mixxx/+bug/1821514) +* Fix dropping track from OSX Finder. [lp:1822424](https://bugs.launchpad.net/mixxx/+bug/1822424) ## [2.1.7](https://launchpad.net/mixxx/+milestone/2.1.7) (2019-01-15) From bac92d588ce0699c788b6367be820f3723263c3b Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 1 Sep 2021 14:18:45 +0200 Subject: [PATCH 3/4] CHANGELOG.md: Remove duplicate entry for version 2.1.8 --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31a2b65a01b..17a653a1074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -266,7 +266,6 @@ * Fix a rare chance for a corrupt track file while writing metadata in out of disk situations. [lp:1815305](https://bugs.launchpad.net/mixxx/+bug/1815305) * Fix export of BPM track file metadata. [lp:1816490](https://bugs.launchpad.net/mixxx/+bug/1816490) -* Fix export of BPM track file metadata. [lp:1816490](https://bugs.launchpad.net/mixxx/+bug/1816490) * Fix sending of broadcast metadata with TLS enabled libshout 2.4.1. [lp:1817395](https://bugs.launchpad.net/mixxx/+bug/1817395) * Fix resdicovering purged tracks in all cases. [lp:1821514](https://bugs.launchpad.net/mixxx/+bug/1821514) * Fix dropping track from OSX Finder. [lp:1822424](https://bugs.launchpad.net/mixxx/+bug/1822424) From a1428a2fdeef3b50638082fe79e44ac96199109f Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sat, 4 Sep 2021 18:06:31 +0200 Subject: [PATCH 4/4] tools/changelog.py: Fix edge case when passing "-" (stdin) By using `pathlib.Path` instead of `argparse.FileType`, we can restrict the files to actual paths (not stdin/stdout/stderr) and also get rid of the ugly seeking/truncating and manual closing of the file. --- tools/changelog.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/changelog.py b/tools/changelog.py index f062189967f..22d27ab35f6 100755 --- a/tools/changelog.py +++ b/tools/changelog.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import argparse +import pathlib import re @@ -24,17 +25,17 @@ def add_missing_links(changelog): def main(argv=None): parser = argparse.ArgumentParser() - parser.add_argument("file", type=argparse.FileType("r+")) + parser.add_argument("file", type=pathlib.Path) args = parser.parse_args(argv) # Fetch changelog and convert to RST - changelog = args.file.read() + with args.file.open("r") as fp: + changelog = fp.read() + fixed_changelog = add_missing_links(changelog) if changelog != fixed_changelog: - args.file.seek(0) - args.file.write(fixed_changelog) - args.file.truncate() - args.file.close() + with args.file.open("w") as fp: + fp.write(fixed_changelog) if __name__ == "__main__":