Skip to content

Commit

Permalink
ci: add codecov (st3v3nmw#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v3nmw authored Oct 15, 2024
1 parent 1c0f685 commit b0b5b84
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ jobs:

- name: Test
run: pnpm test

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Flashcard-Based and Note-Based Spaced Repetition Plugin
# Obsidian Spaced Repetition Plugin

<img src="https://img.shields.io/github/downloads/st3v3nmw/obsidian-spaced-repetition/total" /> <img src="https://img.shields.io/github/downloads/st3v3nmw/obsidian-spaced-repetition/latest/total?style=flat-square" /> <img src="https://img.shields.io/github/manifest-json/v/st3v3nmw/obsidian-spaced-repetition?style=flat-square" />
<img src="https://img.shields.io/github/downloads/st3v3nmw/obsidian-spaced-repetition/total" /> <img src="https://img.shields.io/github/downloads/st3v3nmw/obsidian-spaced-repetition/latest/total?style=flat-square" /> <img src="https://img.shields.io/github/manifest-json/v/st3v3nmw/obsidian-spaced-repetition?style=flat-square" /> <img alt="Codecov" src="https://img.shields.io/codecov/c/gh/st3v3nmw/obsidian-spaced-repetition">

Fight the forgetting curve & note aging by reviewing flashcards & notes using spaced repetition on Obsidian.md
Fight the forgetting curve by reviewing flashcards & notes using spaced repetition.

- Check the documentation [here](https://www.stephenmwangi.com/obsidian-spaced-repetition/).
- Check the [roadmap](https://github.com/st3v3nmw/obsidian-spaced-repetition/projects/3/) for upcoming features & fixes.
Expand Down
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
coverage:
range: 90..100
round: down
precision: 2
status:
project: off
patch:
default:
target: 100
threshold: 0.0
only_pulls: true
changes: off
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ export function parse(text: string, options: ParserOptions): ParsedQuestionInfo[
continue;
}

// Have we reached a card end marker?
// Have we reached the end of a card?
const isEmptyLine = currentTrimmed.length == 0;
const hasMultilineCardEndMarker =
options.multilineCardEndMarker && currentTrimmed == options.multilineCardEndMarker;
if (
// We've possibly reached the end of a card
// We've probably reached the end of a card
(isEmptyLine && !options.multilineCardEndMarker) ||
// Empty line & we're not picking up any card
(isEmptyLine && cardText.length == 0) ||
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,14 @@ test("Test parsing cards with codeblocks", () => {
expect(
parseT(
"How do you ... Python?\n?\n" +
"```\nprint('Hello World!')\n\n\nprint('Howdy?')\n\nlambda x: x[0]\n```",
"```python\nprint('Hello World!')\n\n\nprint('Howdy?')\n\nlambda x: x[0]\n```",
parserOptions,
),
).toEqual([
[
CardType.MultiLineBasic,
"How do you ... Python?\n?\n" +
"```\nprint('Hello World!')\n\n\nprint('Howdy?')\n\nlambda x: x[0]\n```",
"```python\nprint('Hello World!')\n\n\nprint('Howdy?')\n\nlambda x: x[0]\n```",
0,
9,
],
Expand Down

0 comments on commit b0b5b84

Please sign in to comment.