Skip to content

Commit

Permalink
Enhance linting tasks in Taskfile.yml for improved error handling
Browse files Browse the repository at this point in the history
- Updated markdownlint command to use quotes for better path handling.
- Added conditional check for the existence of _config.yml before running yamllint, with a warning message if the file is not found. This improves robustness in the linting process.
  • Loading branch information
jonesrussell committed Jan 11, 2025
1 parent 7da0e94 commit a6c1624
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ tasks:
desc: Lint markdown files and front matter
deps: [lint:pull]
cmds:
- docker run -v ${PWD}:/workdir --rm -w /workdir davidanson/markdownlint-cli2 "_posts/**/*.md" "*.md"
- docker run -v ${PWD}:/workdir --rm -w /workdir cytopia/yamllint _config.yml _posts/
- docker run -v "${PWD}:/workdir" --rm -w /workdir davidanson/markdownlint-cli2 "_posts/**/*.md" "*.md"
- |
if [ -f "_config.yml" ]; then
docker run -v "${PWD}:/workdir" --rm -w /workdir cytopia/yamllint .
else
echo "Warning: _config.yml not found"
exit 1
fi
lint:pull:
desc: Pull required Docker images
Expand Down

0 comments on commit a6c1624

Please sign in to comment.