-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
docs: readability changes #57
Conversation
WalkthroughThis PR refactors the code by replacing the Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (7)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 255 252 -3
Branches 59 58 -1
=========================================
- Hits 255 252 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Docstrings generation was requested by @brianrodri. * #57 (comment) The following files were modified: * `src/model/collection/periodic-notes.ts` * `src/model/collection/util.ts` * `src/model/task/util.ts` * `src/util/luxon-utils.ts`
Note Generated docstrings for this pull request at #58 |
Docstrings generation was requested by @brianrodri. * #57 (comment) The following files were modified: * `src/model/collection/periodic-notes.ts` * `src/model/collection/util.ts` * `src/model/task/util.ts` * `src/util/luxon-utils.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/model/collection/periodic-notes.ts
(3 hunks)src/model/collection/util.ts
(1 hunks)src/model/task/util.ts
(1 hunks)src/util/luxon-utils.ts
(2 hunks)
🧰 Additional context used
🪛 GitHub Check: build:ci
src/model/collection/periodic-notes.ts
[failure] 114-114:
Expected only 0 line after block description
[failure] 118-118:
Expected no lines between tags
[failure] 119-119:
tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
[failure] 119-119:
tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
src/model/collection/util.ts
[failure] 4-4:
Expected only 0 line after block description
src/model/task/util.ts
[failure] 10-10:
Expected only 0 line after block description
src/util/luxon-utils.ts
[failure] 16-16:
Expected only 0 line after block description
[failure] 20-20:
Expected no lines between tags
[failure] 21-21:
tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
[failure] 21-21:
tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
🪛 ESLint
src/model/collection/periodic-notes.ts
[error] 114-114: Expected only 0 line after block description
(jsdoc/tag-lines)
[error] 118-118: Expected no lines between tags
(jsdoc/tag-lines)
[error] 119-119: tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
(tsdoc/syntax)
[error] 119-119: tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
(tsdoc/syntax)
src/model/collection/util.ts
[error] 4-4: Expected only 0 line after block description
(jsdoc/tag-lines)
src/model/task/util.ts
[error] 10-10: Expected only 0 line after block description
(jsdoc/tag-lines)
src/util/luxon-utils.ts
[error] 16-16: Expected only 0 line after block description
(jsdoc/tag-lines)
[error] 20-20: Expected no lines between tags
(jsdoc/tag-lines)
[error] 21-21: tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
(tsdoc/syntax)
[error] 21-21: tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
(tsdoc/syntax)
🪛 GitHub Actions: CI
src/model/collection/periodic-notes.ts
[error] 114-114: ESLint: Expected only 0 line after block description (jsdoc/tag-lines)
🔇 Additional comments (13)
src/model/collection/util.ts (2)
2-7
: Enhanced function documentation.The documentation now clearly explains the function's behavior, with good specificity about when trailing slashes are removed and the special handling for the root path.
🧰 Tools
🪛 GitHub Check: build:ci
[failure] 4-4:
Expected only 0 line after block description🪛 ESLint
[error] 4-4: Expected only 0 line after block description
(jsdoc/tag-lines)
9-9
: More descriptive function name.Renaming from
sanitizeFolder
tostripTrailingSlash
is a good change as it more accurately describes what the function actually does.src/model/task/util.ts (1)
8-13
: Improved function documentation.The documentation now provides a more detailed explanation of how the function merges partial Task objects and handles different property types.
🧰 Tools
🪛 GitHub Check: build:ci
[failure] 10-10:
Expected only 0 line after block description🪛 ESLint
[error] 10-10: Expected only 0 line after block description
(jsdoc/tag-lines)
src/util/luxon-utils.ts (3)
1-1
: Simplified import statement.Importing
assert
directly rather than importingAssertionError
and renamingok
toassert
makes the code cleaner.
12-21
: Enhanced function documentation.The improved documentation clearly explains what the function does, its parameters, and when it throws errors.
🧰 Tools
🪛 GitHub Check: build:ci
[failure] 16-16:
Expected only 0 line after block description
[failure] 20-20:
Expected no lines between tags
[failure] 21-21:
tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
[failure] 21-21:
tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag🪛 ESLint
[error] 16-16: Expected only 0 line after block description
(jsdoc/tag-lines)
[error] 20-20: Expected no lines between tags
(jsdoc/tag-lines)
[error] 21-21: tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
(tsdoc/syntax)
[error] 21-21: tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
(tsdoc/syntax)
27-30
: Improved error handling implementation.The new implementation is more concise and directly uses
assert
to validate and throw errors, eliminating the need for explicit conditional checks.src/model/collection/periodic-notes.ts (7)
1-5
: Updated imports for clarity and type safety.Changed from importing
assert
tonotStrictEqual as assertNotStrictEqual
for more specific error handling, and addedDeepReadonly
for improved type safety.
10-10
: Updated function reference.Changed from
sanitizeFolder
tostripTrailingSlash
for consistency with the renamed function.
28-28
: Enhanced type safety.Changing
dateOptions
type fromDateTimeOptions
toDeepReadonly<DateTimeOptions>
prevents accidental modifications to the options after they're set.
73-102
: Improved type definition structure.The
PeriodicNotesConfig
type has been redefined with clearer conditional typing and better documentation.
104-120
: Added comprehensive function documentation.New detailed documentation for the
validated
function clearly explains its purpose, validation steps, return values, and potential errors.🧰 Tools
🪛 GitHub Check: build:ci
[failure] 114-114:
Expected only 0 line after block description
[failure] 118-118:
Expected no lines between tags
[failure] 119-119:
tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
[failure] 119-119:
tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag🪛 ESLint
[error] 114-114: Expected only 0 line after block description
(jsdoc/tag-lines)
[error] 118-118: Expected no lines between tags
(jsdoc/tag-lines)
[error] 119-119: tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
(tsdoc/syntax)
[error] 119-119: tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
(tsdoc/syntax)
🪛 GitHub Actions: CI
[error] 114-114: ESLint: Expected only 0 line after block description (jsdoc/tag-lines)
122-125
: Improved validation logic.Changed to use
stripTrailingSlash
for folder handling and added cloning fordateOptions
to prevent modifications to the original configuration.
129-134
: Updated assertion mechanism.Using
assertNotStrictEqual
instead of direct assertion provides clearer error messages for validation failures.
Docstrings generation was requested by @brianrodri. * #57 (comment) The following files were modified: * `src/model/collection/periodic-notes.ts`
Note Generated docstrings for this pull request at #59 |
* 📝 Add docstrings to `docs` Docstrings generation was requested by @brianrodri. * #57 (comment) The following files were modified: * `src/model/collection/periodic-notes.ts` * Update src/model/collection/periodic-notes.ts * Update periodic-notes.ts --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Brian Rodriguez <[email protected]>
Summary by CodeRabbit
Refactor
sanitizeFolder
withstripTrailingSlash
.Documentation
DateBasedCollection
andVaultIndex
.mergeTaskParts
andassertValid
for improved clarity.Tests