From ad5e4963e0de0d506232653cb0f5217e7950e5c1 Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Mon, 20 May 2024 15:09:11 -0500 Subject: [PATCH 1/9] Add Ruff into tox config, removing Black and deferring Clang format --- dev-requirements.txt | 3 ++- tox.ini | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index ccdd0676..cc97c52a 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -7,5 +7,6 @@ ipython ipdb pip>=20 pybind11>=2.10.4 +ruff setuptools>=42 -wheel \ No newline at end of file +wheel diff --git a/tox.ini b/tox.ini index 775aa417..f5e4754c 100644 --- a/tox.ini +++ b/tox.ini @@ -15,25 +15,24 @@ deps = -rdocs-requirements.txt commands = # interrogate -vv --fail-under 40 pedalboard +[testenv:check-python-formatting] +basepython = python3 +deps = ruff +skip_install = true +commands = ruff check ./ --ignore=E203,F541 --exclude .git,dist,doc,build,vendors,'*.pyi' --line-length 100 -; "black" is a code formatter, much like gofmt. It requires 3.6 or higher. -; This env just runs `black` and fails tox if it's not formatted correctly. -; If this env fails on Tingle, run `tox -e format` locally in order to apply changes. -[testenv:check-formatting] +[testenv:check-python-formatting] basepython = python3 -deps = black +deps = ruff skip_install = true -commands = - # black pedalboard tests --line-length 120 --experimental-string-processing --diff --check - # clang-format -style=LLVM pedalboard.cpp +commands = ruff format ./ --exclude .git,dist,doc,build,JUCE,examples,vendors,'*.pyi' --diff --line-length 100 [testenv:format] basepython = python3 -deps = black skip_install = true commands = - # black pedalboard tests --line-length 120 --experimental-string-processing - clang-format -style=LLVM -i pedalboard.cpp + #clang-format -style=LLVM -i pedalboard.cpp + #clang-format -style=LLVM pedalboard.cpp [testenv:lint] ; feel free to add flake8 plugins (i.e. flake8-import-order), add isort, From ad7522b6fb1f147f1cbad9687d32b5e57f5ec21a Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Mon, 20 May 2024 15:21:42 -0500 Subject: [PATCH 2/9] Update tox config so it actually formats the files --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index f5e4754c..57961327 100644 --- a/tox.ini +++ b/tox.ini @@ -21,11 +21,11 @@ deps = ruff skip_install = true commands = ruff check ./ --ignore=E203,F541 --exclude .git,dist,doc,build,vendors,'*.pyi' --line-length 100 -[testenv:check-python-formatting] +[testenv:format-python] basepython = python3 deps = ruff skip_install = true -commands = ruff format ./ --exclude .git,dist,doc,build,JUCE,examples,vendors,'*.pyi' --diff --line-length 100 +commands = ruff format ./ --exclude .git,dist,doc,build,JUCE,examples,vendors,'*.pyi' --line-length 100 [testenv:format] basepython = python3 From d6199f0cbd5b3ef83fbd209b4b42fc33b5f55a20 Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Tue, 21 May 2024 12:59:57 -0500 Subject: [PATCH 3/9] Add clang-format into tox.ini --- tox.ini | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 57961327..b4acb7bc 100644 --- a/tox.ini +++ b/tox.ini @@ -27,12 +27,11 @@ deps = ruff skip_install = true commands = ruff format ./ --exclude .git,dist,doc,build,JUCE,examples,vendors,'*.pyi' --line-length 100 -[testenv:format] -basepython = python3 +[testenv:format-cpp] skip_install = true -commands = - #clang-format -style=LLVM -i pedalboard.cpp - #clang-format -style=LLVM pedalboard.cpp +deps = +allowlist_externals = find, xargs, clang-format +commands = find pedalboard/ -name '*.cpp' -o -name '*.h' | xargs clang-format -i [testenv:lint] ; feel free to add flake8 plugins (i.e. flake8-import-order), add isort, From 9bda13663e774fc2d71532a11250083f865a4db1 Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Tue, 21 May 2024 13:51:33 -0500 Subject: [PATCH 4/9] Add clang script/config and integrate with tox.ini --- .clang-format | 1 + scripts/format_cpp.sh | 3 +++ tox.ini | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .clang-format create mode 100755 scripts/format_cpp.sh diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..9b3aa8b7 --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: LLVM diff --git a/scripts/format_cpp.sh b/scripts/format_cpp.sh new file mode 100755 index 00000000..6008c99f --- /dev/null +++ b/scripts/format_cpp.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set +x +find pedalboard/ -name '*.cpp' -o -name '*.h' | xargs clang-format -i diff --git a/tox.ini b/tox.ini index b4acb7bc..d833c3e6 100644 --- a/tox.ini +++ b/tox.ini @@ -30,8 +30,8 @@ commands = ruff format ./ --exclude .git,dist,doc,build,JUCE,examples,vendors,'* [testenv:format-cpp] skip_install = true deps = -allowlist_externals = find, xargs, clang-format -commands = find pedalboard/ -name '*.cpp' -o -name '*.h' | xargs clang-format -i +allowlist_externals = find, xargs, clang-format, echo, ./scripts/format_cpp.sh +commands = ./scripts/format_cpp.sh [testenv:lint] ; feel free to add flake8 plugins (i.e. flake8-import-order), add isort, From 4840f8609383e4d34a19aec1ce2ab6c49acdb207 Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Tue, 21 May 2024 13:52:57 -0500 Subject: [PATCH 5/9] Clang format with current setup --- pedalboard/JucePlugin.h | 2 +- pedalboard/Plugin.h | 2 +- pedalboard/PluginContainer.h | 2 +- pedalboard/RubberbandPlugin.h | 2 +- pedalboard/io/LameMP3AudioFormat.h | 4 ++-- pedalboard/plugin_templates/FixedBlockSize.h | 4 ++-- pedalboard/plugin_templates/ForceMono.h | 4 ++-- pedalboard/plugin_templates/PrimeWithSilence.h | 4 ++-- pedalboard/plugin_templates/Resample.h | 4 ++-- pedalboard/plugins/AddLatency.h | 2 +- pedalboard/plugins/Chain.h | 2 +- pedalboard/plugins/GSMFullRateCompressor.h | 2 +- pedalboard/plugins/MP3Compressor.h | 2 +- pedalboard/plugins/Mix.h | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pedalboard/JucePlugin.h b/pedalboard/JucePlugin.h index 8c2526aa..407c847e 100644 --- a/pedalboard/JucePlugin.h +++ b/pedalboard/JucePlugin.h @@ -47,7 +47,7 @@ namespace Pedalboard { */ template class JucePlugin : public Plugin { public: - virtual ~JucePlugin(){}; + virtual ~JucePlugin() {}; void prepare(const juce::dsp::ProcessSpec &spec) override { if (lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/Plugin.h b/pedalboard/Plugin.h index dfe6c855..f915106f 100644 --- a/pedalboard/Plugin.h +++ b/pedalboard/Plugin.h @@ -28,7 +28,7 @@ namespace Pedalboard { */ class Plugin { public: - virtual ~Plugin(){}; + virtual ~Plugin() {}; /** * Prepare the data structures that will be necessary for this plugin to diff --git a/pedalboard/PluginContainer.h b/pedalboard/PluginContainer.h index d342fdf9..b458060c 100644 --- a/pedalboard/PluginContainer.h +++ b/pedalboard/PluginContainer.h @@ -54,7 +54,7 @@ class PluginContainer : public Plugin { plugins = _plugins; } - virtual ~PluginContainer(){}; + virtual ~PluginContainer() {}; std::vector> &getPlugins() { return plugins; } diff --git a/pedalboard/RubberbandPlugin.h b/pedalboard/RubberbandPlugin.h index ddb3bbb2..0c1c8417 100644 --- a/pedalboard/RubberbandPlugin.h +++ b/pedalboard/RubberbandPlugin.h @@ -27,7 +27,7 @@ namespace Pedalboard { */ class RubberbandPlugin : public Plugin { public: - virtual ~RubberbandPlugin(){}; + virtual ~RubberbandPlugin() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) override { bool specChanged = lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/io/LameMP3AudioFormat.h b/pedalboard/io/LameMP3AudioFormat.h index 463ee8e4..cee2ebe6 100644 --- a/pedalboard/io/LameMP3AudioFormat.h +++ b/pedalboard/io/LameMP3AudioFormat.h @@ -28,8 +28,8 @@ static const inline int MAXIMUM_MP3_FRAME_SIZE = 7200; namespace Pedalboard { class LameMP3AudioFormat : public juce::AudioFormat { public: - LameMP3AudioFormat() : juce::AudioFormat("MP3", ".mp3"){}; - ~LameMP3AudioFormat(){}; + LameMP3AudioFormat() : juce::AudioFormat("MP3", ".mp3") {}; + ~LameMP3AudioFormat() {}; juce::Array getPossibleSampleRates() { return {32000, 44100, 48000}; } juce::Array getPossibleBitDepths() { return {16}; } diff --git a/pedalboard/plugin_templates/FixedBlockSize.h b/pedalboard/plugin_templates/FixedBlockSize.h index 16ca0159..9ec0b141 100644 --- a/pedalboard/plugin_templates/FixedBlockSize.h +++ b/pedalboard/plugin_templates/FixedBlockSize.h @@ -34,7 +34,7 @@ template class FixedBlockSize : public Plugin { public: - virtual ~FixedBlockSize(){}; + virtual ~FixedBlockSize() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { if (lastSpec.sampleRate != spec.sampleRate || @@ -259,7 +259,7 @@ class FixedBlockSize : public Plugin { */ class ExpectsFixedBlockSize : public AddLatency { public: - virtual ~ExpectsFixedBlockSize(){}; + virtual ~ExpectsFixedBlockSize() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { if (spec.maximumBlockSize != expectedBlockSize) { diff --git a/pedalboard/plugin_templates/ForceMono.h b/pedalboard/plugin_templates/ForceMono.h index 70ba24aa..dd4a6013 100644 --- a/pedalboard/plugin_templates/ForceMono.h +++ b/pedalboard/plugin_templates/ForceMono.h @@ -32,7 +32,7 @@ namespace Pedalboard { template class ForceMono : public Plugin { public: - virtual ~ForceMono(){}; + virtual ~ForceMono() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { juce::dsp::ProcessSpec newSpec = spec; @@ -88,7 +88,7 @@ class ForceMono : public Plugin { */ class ExpectsMono : public AddLatency { public: - virtual ~ExpectsMono(){}; + virtual ~ExpectsMono() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { if (spec.numChannels != 1) { diff --git a/pedalboard/plugin_templates/PrimeWithSilence.h b/pedalboard/plugin_templates/PrimeWithSilence.h index 603d5293..adf6ab58 100644 --- a/pedalboard/plugin_templates/PrimeWithSilence.h +++ b/pedalboard/plugin_templates/PrimeWithSilence.h @@ -34,7 +34,7 @@ class PrimeWithSilence : public JucePlugin> { public: - virtual ~PrimeWithSilence(){}; + virtual ~PrimeWithSilence() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { JucePlugin class Passthrough : public Plugin { public: - virtual ~Passthrough(){}; + virtual ~Passthrough() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) {} @@ -178,7 +178,7 @@ template , typename SampleType = float, int DefaultSampleRate = 8000> class Resample : public Plugin { public: - virtual ~Resample(){}; + virtual ~Resample() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { bool specChanged = lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/plugins/AddLatency.h b/pedalboard/plugins/AddLatency.h index 86bf7199..f24c515c 100644 --- a/pedalboard/plugins/AddLatency.h +++ b/pedalboard/plugins/AddLatency.h @@ -29,7 +29,7 @@ namespace Pedalboard { class AddLatency : public JucePlugin> { public: - virtual ~AddLatency(){}; + virtual ~AddLatency() {}; virtual void reset() override { getDSP().reset(); diff --git a/pedalboard/plugins/Chain.h b/pedalboard/plugins/Chain.h index af2ad2c0..e1453507 100644 --- a/pedalboard/plugins/Chain.h +++ b/pedalboard/plugins/Chain.h @@ -31,7 +31,7 @@ class Chain : public PluginContainer { public: Chain(std::vector> plugins) : PluginContainer(plugins) {} - virtual ~Chain(){}; + virtual ~Chain() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { for (auto plugin : plugins) { diff --git a/pedalboard/plugins/GSMFullRateCompressor.h b/pedalboard/plugins/GSMFullRateCompressor.h index ce421902..81109aa7 100644 --- a/pedalboard/plugins/GSMFullRateCompressor.h +++ b/pedalboard/plugins/GSMFullRateCompressor.h @@ -55,7 +55,7 @@ class GSMWrapper { class GSMFullRateCompressorInternal : public Plugin { public: - virtual ~GSMFullRateCompressorInternal(){}; + virtual ~GSMFullRateCompressorInternal() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) override { bool specChanged = lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/plugins/MP3Compressor.h b/pedalboard/plugins/MP3Compressor.h index 3145adc7..4f30b35b 100644 --- a/pedalboard/plugins/MP3Compressor.h +++ b/pedalboard/plugins/MP3Compressor.h @@ -152,7 +152,7 @@ class Int16OutputBuffer { class MP3Compressor : public Plugin { public: - virtual ~MP3Compressor(){}; + virtual ~MP3Compressor() {}; void setVBRQuality(float newLevel) { if (newLevel < 0 || newLevel > 10) { diff --git a/pedalboard/plugins/Mix.h b/pedalboard/plugins/Mix.h index 16ddc1eb..3c4d0d03 100644 --- a/pedalboard/plugins/Mix.h +++ b/pedalboard/plugins/Mix.h @@ -32,7 +32,7 @@ class Mix : public PluginContainer { Mix(std::vector> plugins) : PluginContainer(plugins), pluginBuffers(plugins.size()), samplesAvailablePerPlugin(plugins.size()) {} - virtual ~Mix(){}; + virtual ~Mix() {}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { for (auto plugin : plugins) { From a90abe30f5406a74e582e8fb5245e51400d68a0e Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Tue, 21 May 2024 15:00:36 -0500 Subject: [PATCH 6/9] Revert "Clang format with current setup" This reverts commit 4840f8609383e4d34a19aec1ce2ab6c49acdb207. --- pedalboard/JucePlugin.h | 2 +- pedalboard/Plugin.h | 2 +- pedalboard/PluginContainer.h | 2 +- pedalboard/RubberbandPlugin.h | 2 +- pedalboard/io/LameMP3AudioFormat.h | 4 ++-- pedalboard/plugin_templates/FixedBlockSize.h | 4 ++-- pedalboard/plugin_templates/ForceMono.h | 4 ++-- pedalboard/plugin_templates/PrimeWithSilence.h | 4 ++-- pedalboard/plugin_templates/Resample.h | 4 ++-- pedalboard/plugins/AddLatency.h | 2 +- pedalboard/plugins/Chain.h | 2 +- pedalboard/plugins/GSMFullRateCompressor.h | 2 +- pedalboard/plugins/MP3Compressor.h | 2 +- pedalboard/plugins/Mix.h | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pedalboard/JucePlugin.h b/pedalboard/JucePlugin.h index 407c847e..8c2526aa 100644 --- a/pedalboard/JucePlugin.h +++ b/pedalboard/JucePlugin.h @@ -47,7 +47,7 @@ namespace Pedalboard { */ template class JucePlugin : public Plugin { public: - virtual ~JucePlugin() {}; + virtual ~JucePlugin(){}; void prepare(const juce::dsp::ProcessSpec &spec) override { if (lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/Plugin.h b/pedalboard/Plugin.h index f915106f..dfe6c855 100644 --- a/pedalboard/Plugin.h +++ b/pedalboard/Plugin.h @@ -28,7 +28,7 @@ namespace Pedalboard { */ class Plugin { public: - virtual ~Plugin() {}; + virtual ~Plugin(){}; /** * Prepare the data structures that will be necessary for this plugin to diff --git a/pedalboard/PluginContainer.h b/pedalboard/PluginContainer.h index b458060c..d342fdf9 100644 --- a/pedalboard/PluginContainer.h +++ b/pedalboard/PluginContainer.h @@ -54,7 +54,7 @@ class PluginContainer : public Plugin { plugins = _plugins; } - virtual ~PluginContainer() {}; + virtual ~PluginContainer(){}; std::vector> &getPlugins() { return plugins; } diff --git a/pedalboard/RubberbandPlugin.h b/pedalboard/RubberbandPlugin.h index 0c1c8417..ddb3bbb2 100644 --- a/pedalboard/RubberbandPlugin.h +++ b/pedalboard/RubberbandPlugin.h @@ -27,7 +27,7 @@ namespace Pedalboard { */ class RubberbandPlugin : public Plugin { public: - virtual ~RubberbandPlugin() {}; + virtual ~RubberbandPlugin(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) override { bool specChanged = lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/io/LameMP3AudioFormat.h b/pedalboard/io/LameMP3AudioFormat.h index cee2ebe6..463ee8e4 100644 --- a/pedalboard/io/LameMP3AudioFormat.h +++ b/pedalboard/io/LameMP3AudioFormat.h @@ -28,8 +28,8 @@ static const inline int MAXIMUM_MP3_FRAME_SIZE = 7200; namespace Pedalboard { class LameMP3AudioFormat : public juce::AudioFormat { public: - LameMP3AudioFormat() : juce::AudioFormat("MP3", ".mp3") {}; - ~LameMP3AudioFormat() {}; + LameMP3AudioFormat() : juce::AudioFormat("MP3", ".mp3"){}; + ~LameMP3AudioFormat(){}; juce::Array getPossibleSampleRates() { return {32000, 44100, 48000}; } juce::Array getPossibleBitDepths() { return {16}; } diff --git a/pedalboard/plugin_templates/FixedBlockSize.h b/pedalboard/plugin_templates/FixedBlockSize.h index 9ec0b141..16ca0159 100644 --- a/pedalboard/plugin_templates/FixedBlockSize.h +++ b/pedalboard/plugin_templates/FixedBlockSize.h @@ -34,7 +34,7 @@ template class FixedBlockSize : public Plugin { public: - virtual ~FixedBlockSize() {}; + virtual ~FixedBlockSize(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { if (lastSpec.sampleRate != spec.sampleRate || @@ -259,7 +259,7 @@ class FixedBlockSize : public Plugin { */ class ExpectsFixedBlockSize : public AddLatency { public: - virtual ~ExpectsFixedBlockSize() {}; + virtual ~ExpectsFixedBlockSize(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { if (spec.maximumBlockSize != expectedBlockSize) { diff --git a/pedalboard/plugin_templates/ForceMono.h b/pedalboard/plugin_templates/ForceMono.h index dd4a6013..70ba24aa 100644 --- a/pedalboard/plugin_templates/ForceMono.h +++ b/pedalboard/plugin_templates/ForceMono.h @@ -32,7 +32,7 @@ namespace Pedalboard { template class ForceMono : public Plugin { public: - virtual ~ForceMono() {}; + virtual ~ForceMono(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { juce::dsp::ProcessSpec newSpec = spec; @@ -88,7 +88,7 @@ class ForceMono : public Plugin { */ class ExpectsMono : public AddLatency { public: - virtual ~ExpectsMono() {}; + virtual ~ExpectsMono(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { if (spec.numChannels != 1) { diff --git a/pedalboard/plugin_templates/PrimeWithSilence.h b/pedalboard/plugin_templates/PrimeWithSilence.h index adf6ab58..603d5293 100644 --- a/pedalboard/plugin_templates/PrimeWithSilence.h +++ b/pedalboard/plugin_templates/PrimeWithSilence.h @@ -34,7 +34,7 @@ class PrimeWithSilence : public JucePlugin> { public: - virtual ~PrimeWithSilence() {}; + virtual ~PrimeWithSilence(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { JucePlugin class Passthrough : public Plugin { public: - virtual ~Passthrough() {}; + virtual ~Passthrough(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) {} @@ -178,7 +178,7 @@ template , typename SampleType = float, int DefaultSampleRate = 8000> class Resample : public Plugin { public: - virtual ~Resample() {}; + virtual ~Resample(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { bool specChanged = lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/plugins/AddLatency.h b/pedalboard/plugins/AddLatency.h index f24c515c..86bf7199 100644 --- a/pedalboard/plugins/AddLatency.h +++ b/pedalboard/plugins/AddLatency.h @@ -29,7 +29,7 @@ namespace Pedalboard { class AddLatency : public JucePlugin> { public: - virtual ~AddLatency() {}; + virtual ~AddLatency(){}; virtual void reset() override { getDSP().reset(); diff --git a/pedalboard/plugins/Chain.h b/pedalboard/plugins/Chain.h index e1453507..af2ad2c0 100644 --- a/pedalboard/plugins/Chain.h +++ b/pedalboard/plugins/Chain.h @@ -31,7 +31,7 @@ class Chain : public PluginContainer { public: Chain(std::vector> plugins) : PluginContainer(plugins) {} - virtual ~Chain() {}; + virtual ~Chain(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { for (auto plugin : plugins) { diff --git a/pedalboard/plugins/GSMFullRateCompressor.h b/pedalboard/plugins/GSMFullRateCompressor.h index 81109aa7..ce421902 100644 --- a/pedalboard/plugins/GSMFullRateCompressor.h +++ b/pedalboard/plugins/GSMFullRateCompressor.h @@ -55,7 +55,7 @@ class GSMWrapper { class GSMFullRateCompressorInternal : public Plugin { public: - virtual ~GSMFullRateCompressorInternal() {}; + virtual ~GSMFullRateCompressorInternal(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) override { bool specChanged = lastSpec.sampleRate != spec.sampleRate || diff --git a/pedalboard/plugins/MP3Compressor.h b/pedalboard/plugins/MP3Compressor.h index 4f30b35b..3145adc7 100644 --- a/pedalboard/plugins/MP3Compressor.h +++ b/pedalboard/plugins/MP3Compressor.h @@ -152,7 +152,7 @@ class Int16OutputBuffer { class MP3Compressor : public Plugin { public: - virtual ~MP3Compressor() {}; + virtual ~MP3Compressor(){}; void setVBRQuality(float newLevel) { if (newLevel < 0 || newLevel > 10) { diff --git a/pedalboard/plugins/Mix.h b/pedalboard/plugins/Mix.h index 3c4d0d03..16ddc1eb 100644 --- a/pedalboard/plugins/Mix.h +++ b/pedalboard/plugins/Mix.h @@ -32,7 +32,7 @@ class Mix : public PluginContainer { Mix(std::vector> plugins) : PluginContainer(plugins), pluginBuffers(plugins.size()), samplesAvailablePerPlugin(plugins.size()) {} - virtual ~Mix() {}; + virtual ~Mix(){}; virtual void prepare(const juce::dsp::ProcessSpec &spec) { for (auto plugin : plugins) { From 0eaf17bcdecac080b878c8a99b43700ae7916609 Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Tue, 21 May 2024 15:26:21 -0500 Subject: [PATCH 7/9] Add clang-format 14 to dev requirements --- dev-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-requirements.txt b/dev-requirements.txt index cc97c52a..d00e99f3 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -3,6 +3,7 @@ -r test-requirements.txt -r docs-requirements.txt bumpversion==0.5.3 +clang-format==14 ipython ipdb pip>=20 From 1b750d776b9d061cc122e2be9c633b27c1dbb5a1 Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Tue, 21 May 2024 15:27:01 -0500 Subject: [PATCH 8/9] Update CONTRIBUTING.md style guide per changes --- CONTRIBUTING.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f37af532..669c90d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,12 @@ tox ## Style -Use [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) for C++ code, and `black` with defaults for Python code. +Use [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) for C++ code and `ruff` for Python code. After setting up tox, one can run: +``` +tox -e check-python-formatting +tox -e format-python +tox -e format-cpp +``` ## Issues From 579fd15f2c3a11cb56f96b914a6710f2cba0492f Mon Sep 17 00:00:00 2001 From: "Ryan S. Davis" Date: Tue, 21 May 2024 15:29:47 -0500 Subject: [PATCH 9/9] Remove debugging code --- scripts/format_cpp.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/format_cpp.sh b/scripts/format_cpp.sh index 6008c99f..8538f9ba 100755 --- a/scripts/format_cpp.sh +++ b/scripts/format_cpp.sh @@ -1,3 +1,2 @@ #!/bin/bash -set +x find pedalboard/ -name '*.cpp' -o -name '*.h' | xargs clang-format -i