Skip to content
38 changes: 38 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,41 @@ jobs:
./build/ace-qwen3 --help 2>&1 | head -5
./build/dit-vae --help 2>&1 | head -5
./build/quantize --help 2>&1 | head -3

lint:
name: Lint & Static Analysis
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4

- name: Install lint tools
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq clang-format clang-tidy cppcheck

- name: Check trailing whitespace
continue-on-error: true
run: |
if grep -rIn --exclude-dir=.git --exclude="*.md,*.log" "[[:blank:]]$" .; then
echo "Trailing whitespace detected!"
exit 1
fi

- name: Run clang-format (check mode)
run: |
find . \
\( -path './.git' -o -path './ggml' -o -path './build' \) -prune -o \
-type f \( -name '*.c' -o -name '*.h' -o -name '*.cc' -o -name '*.cpp' -o -name '*.hpp' \) \
-print0 | xargs -0 clang-format --dry-run --Werror

- name: Run cppcheck
run: |
cppcheck --enable=all --error-exitcode=1 --inline-suppr \
--suppress=missingIncludeSystem \
--suppress=unusedFunction \
--suppress=missingInclude \
--suppress=cstyleCast \
--suppress=constVariable \
-i ggml -i build -i .git \
.
21 changes: 6 additions & 15 deletions src/metadata-fsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,21 +389,12 @@ static void parse_phase1_into_aces(const std::vector<std::string> & texts,
}
aces[i] = base;
// gap fill: only write fields the user left empty
if (parsed.bpm > 0 && base.bpm <= 0) {
aces[i].bpm = parsed.bpm;
}
if (parsed.duration > 0 && base.duration <= 0) {
aces[i].duration = parsed.duration;
}
if (!parsed.keyscale.empty() && base.keyscale.empty()) {
aces[i].keyscale = parsed.keyscale;
}
if (!parsed.timesignature.empty() && base.timesignature.empty()) {
aces[i].timesignature = parsed.timesignature;
}
if (!parsed.vocal_language.empty() && base.vocal_language.empty()) {
aces[i].vocal_language = parsed.vocal_language;
}
if (parsed.bpm > 0 && base.bpm <= 0) aces[i].bpm = parsed.bpm;
if (parsed.duration > 0 && base.duration <= 0) aces[i].duration = parsed.duration;
if (!parsed.keyscale.empty() && base.keyscale.empty()) aces[i].keyscale = parsed.keyscale;
if (!parsed.timesignature.empty() && base.timesignature.empty()) aces[i].timesignature = parsed.timesignature;
if (!parsed.vocal_language.empty() && base.vocal_language.empty()) aces[i].vocal_language = parsed.vocal_language;
if (!parsed.caption.empty()) aces[i].caption = parsed.caption;
// lyrics: only generated when user had none
if (merge_lyrics && !parsed.lyrics.empty()) {
aces[i].lyrics = parsed.lyrics;
Expand Down
Loading