Skip to content

Commit

Permalink
refactor: removed markdownlint changes in this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Jun 9, 2023
1 parent d5b74e0 commit eb31283
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ format:
docs-lint:
markdownlint . --fix

docs-lint-changed:
./scripts/linting/lint-changed-md-files.sh

.PHONY: lint lint-fix lint-fix-changed docs-lint docs-lint-changed

###############################################################################
Expand Down
13 changes: 13 additions & 0 deletions scripts/linting/lint-changed-md-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -euo pipefail

# lint_modified_markdown_files runs the linter only if changes have been made to any md files.
function lint_modified_markdown_files() {
local markdown_files="$(git diff --name-only | grep \.md$)"
for f in $markdown_files; do
markdownlint "${f}" --fix
done
}

lint_modified_markdown_files

0 comments on commit eb31283

Please sign in to comment.