You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pin FASTA detection with tests and fix leading-line handling #338
isFasta in src/common/fastaParser.ts only ever inspects the first line. Its loop runs over every line but reads lines[0] on each pass. So a FASTA file that starts with a blank line or a # comment is not detected, even though parse itself skips blank and # lines and would accept it. Decide what detection should do, pin it with tests, and fix the parser if the current behaviour is wrong.
Found while fixing a prefer-for-of lint report in #335 (PR #337). That change kept the behaviour exactly, so nothing was fixed there.
Questions to settle first
Should a file with leading blank or # lines count as FASTA? parse already skips those lines, which suggests yes. Check parseAlignment and the other format detectors (isPhylip) for how they treat leading blank lines, and match them.
Does anything rely on the current result? Look at the callers of isFasta and parse for a file-format fallback order.
Acceptance criteria
Vitest cases for isFasta pin: > on the first line, a blank first line, a # first line, a blank or comment line followed by >, an empty array, and a non-FASTA first line.
Each case asserts the behaviour settled above. Where today's result is wrong, the fix is in the same change.
parse has a case for a file with leading blank or # lines that agrees with isFasta.
yarn lint, yarn typecheck:baseline and the Vitest suite pass.
Activity