-
Notifications
You must be signed in to change notification settings - Fork 751
feat: enforce markdown formatting on save #6969
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
fba4a46
test: Add in tests for md check
dmadisetti b4a4360
feat: Add markdown tidy rule and auto formatting
dmadisetti 6985ebd
tidy: refresh examples
dmadisetti 6aaaa4a
docs: update documentation rules
dmadisetti b46932f
fix: snapshots
dmadisetti 5669087
fe: adjust markdown
dmadisetti ce947c4
fix: change formatting
dmadisetti bc78429
fix: change formatting
dmadisetti 8ef0897
docs: update docs
dmadisetti d39a1fc
fix: detect overly dedented cells
dmadisetti 28c9204
snapshots: convert
dmadisetti 2371aef
tests: fix for new format
dmadisetti 613978a
tidy: refresh tutorials
dmadisetti 6f4c9bb
fix: ignore markdown files
dmadisetti aeb107f
tests: frontend tests
dmadisetti beaa391
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d1e7b5f
fix: frontend tests
dmadisetti de438a5
ci: add tutorial tests
dmadisetti 48e73dc
fix: stub anonymous file
dmadisetti 004dff3
Merge branch 'dm/md-check' of github:marimo-team/marimo into dm/md-check
dmadisetti 36bd1ca
docs: dedent -> indent
dmadisetti 42fb6ed
snapshots: convert
dmadisetti dddf4e7
fix: missing file
dmadisetti 289246b
fixes
mscolnick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # MF007: markdown-dedent | ||
|
|
||
| ✨ **Formatting** 🛠️ Fixable | ||
|
|
||
| MF007: Markdown strings in `mo.md()` should be dedented. | ||
|
|
||
| ## What it does | ||
|
|
||
| Checks cells containing `mo.md()` calls to see if the markdown string | ||
| content has unnecessary leading whitespace that should be removed. | ||
|
|
||
| ## Why is this bad? | ||
|
|
||
| Indented markdown strings: | ||
| - Are harder to read when viewing the source code | ||
| - Produce larger diffs when making changes | ||
| - Don't match the standard marimo formatting style | ||
| - Can be confusing when the indentation doesn't reflect the markdown structure | ||
|
|
||
| ## Examples | ||
|
|
||
| **Problematic:** | ||
| ```python | ||
| mo.md( | ||
| r""" | ||
| # Title | ||
|
|
||
| Some content here. | ||
| """ | ||
| ) | ||
| ``` | ||
|
|
||
| **Solution:** | ||
| ```python | ||
| mo.md(r""" | ||
| # Title | ||
|
|
||
| Some content here. | ||
| """) | ||
| ``` | ||
|
|
||
| **Note:** This fix is automatically applied with `marimo check --fix`. | ||
|
|
||
| ## References | ||
|
|
||
| - [Understanding Errors](https://docs.marimo.io/guides/understanding_errors/) | ||
| - [Best Practices](https://docs.marimo.io/guides/best_practices/) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
i wonder if the rule should be
markdown-indentationsince it captures more than dedent. but if this is internal, we can change the name whenever