Skip to content

Support MD031 #5

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 31 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a9b1371
MD032: Simplify BFS iteration over nodes; MD032 skeleton
vvvar Apr 8, 2024
0e60366
MD003: Use new AST BFS iterator
vvvar Apr 9, 2024
535ec8f
MD001: Use iterator
vvvar Apr 12, 2024
bcea62e
MD005: Use BFS iterator
vvvar Apr 12, 2024
0e51650
MD005: Shoter iteration
vvvar Apr 12, 2024
ca96288
MD014: Use BFS iterator
vvvar Apr 12, 2024
de26f71
MD019: Use BFS iterator
vvvar Apr 12, 2024
42be9f2
MD022: Use BFS iterator
vvvar Apr 12, 2024
927ebef
MD023: Use BFS iterator
vvvar Apr 12, 2024
92bb1d1
MD024: Apply new bfs iterator
vvvar Apr 20, 2024
0076519
MD025: Use new BFS iterator
vvvar Apr 20, 2024
70af1e1
MD025: Use new BFS iterator
vvvar Apr 20, 2024
9862337
Unify node filtering function
vvvar Apr 20, 2024
31af3d4
Use helper function to bfs lists
vvvar Apr 20, 2024
fa2918d
Use helper function to extract code blocks; MD027 use bfs iterator
vvvar Apr 20, 2024
9aabe2c
Fix doctests; Use BQ BFS iterator helper in MD028
vvvar Apr 20, 2024
3a510d2
M029: Use new BFS iterator
vvvar Apr 20, 2024
3c4f319
MD030: Use new BFS iterator
vvvar Apr 20, 2024
61fcfd0
MD033: Use BFS iterator; Fix cargo warns
vvvar Apr 20, 2024
e21ec48
MD046: Use BFS iterator
vvvar Apr 20, 2024
702160b
MD051: Use new BFS iterator
vvvar Apr 21, 2024
64b9e03
Clean up usage of old AST APIs
vvvar Apr 21, 2024
d67176b
Fix clippy errors; MD031: Parametrise list items; Allow only config f…
vvvar May 3, 2024
d2b4f44
Fix clippy errors
vvvar May 3, 2024
23aafaa
Bump version
vvvar May 3, 2024
661a4cd
replace workflow with new
vvvar May 3, 2024
7787fb1
Merge branch 'main' into md031
vvvar May 3, 2024
ee0659f
Test on all platforms
vvvar May 3, 2024
436ca00
Build as part of the CI quality gate
vvvar May 3, 2024
3384d96
Check instead of build to save time
vvvar May 3, 2024
359926f
Audit files
vvvar May 3, 2024
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
46 changes: 0 additions & 46 deletions .github/release.yml

This file was deleted.

103 changes: 51 additions & 52 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,54 @@ env:
on: [pull_request]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: nightly
components: clippy
- name: Build | Lint
run: cargo clippy
- name: Build | Check Unused Deps
run: |
cargo install cargo-udeps --locked
cargo udeps
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
- name: Build | Compile
run: cargo check
test:
name: Test
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
rust:
- stable
- beta
- nightly
runs-on: ${{ matrix.os }}
needs: [compile]
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: ${{ matrix.rust }}
- name: Build | Test
run: cargo test
check:
name: cargo check
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo check --release

test:
name: cargo test
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo test --all-features

formatting:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Ensure rustfmt is installed and setup problem matcher
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1

# Check formatting with rustfmt
lint:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Ensure rustfmt is installed and setup problem matcher
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- run: cargo test --all-features
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion checkmark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
allow_insecure=false

[linter]
allowed_html_tags=["img"]
md031_list_items=true
md033_allowed_html_tags=["img"]

[review]
no_suggestions=false
Expand Down
2 changes: 1 addition & 1 deletion src/checkmark_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "checkmark_cli"
description = "A CLI tool that helps maintain high-quality Markdown documentation by checking for formatting, grammatical, and spelling errors, as well as broken links"
version = "0.5.0"
version = "0.6.0"
edition = "2021"

[[bin]]
Expand Down
6 changes: 1 addition & 5 deletions src/checkmark_cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,7 @@ pub struct LinkcheckCommand {

#[derive(Debug, clap::Parser)]
#[command(long_about = None)]
pub struct LintCommand {
/// MD033: List of HTML tags to allow in the document
#[arg(long, short)]
pub allowed_html_tags: Vec<String>,
}
pub struct LintCommand {}

#[derive(Debug, clap::Parser)]
#[command(long_about = None)]
Expand Down
6 changes: 1 addition & 5 deletions src/checkmark_cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ pub fn read_config(cli: &crate::cli::Cli) -> common::Config {
config.link_checker.allow_insecure = true;
}
}
crate::cli::Subcommands::Lint(lint) => {
if !lint.allowed_html_tags.is_empty() {
config.linter.allowed_html_tags = lint.allowed_html_tags.clone();
}
}
crate::cli::Subcommands::Lint(_) => {}
crate::cli::Subcommands::Review(review) => {
config.review.no_suggestions = review.no_suggestions;
if let Some(prompt) = &review.prompt {
Expand Down
2 changes: 1 addition & 1 deletion src/checkmark_fmt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "checkmark_fmt"
description = "Library to work with Markdown formatting"
version = "0.0.1"
version = "0.1.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/checkmark_fmt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ pub fn fmt_markdown(file: &common::MarkDownFile, config: &common::Config) -> com
log::debug!("Formatting options: {:#?}", &fmt_options);

let mut buffer: String = String::from("");
let ast = common::parse(&file.content).unwrap();
let ast = common::ast::parse(&file.content).unwrap();
to_md(
&ast,
&mut buffer,
Expand Down
Loading