Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add codecov #1131

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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