Skip to content

Commit

Permalink
fix: lint GitHub issue and pull request templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-grande committed Jul 4, 2024
1 parent f46504a commit 2a4b453
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 28 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ assignees: ''

I confirm that I have read the following resources:

- [How to troubleshoot Qusal](https://github.com/ben-grande/qusal/blob/main/docs/TROUBLESHOOT.md)
- [How to ask questions The Smart Way](http://catb.org/esr/faqs/smart-questions.html)
- [Writing the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)
- [Question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/)
- [Could you please make my preference the default?](https://www.qubes-os.org/faq/#could-you-please-make-my-preference-the-default)
* [How to troubleshoot Qusal](https://github.com/ben-grande/qusal/blob/main/docs/TROUBLESHOOT.md)
* [How to ask questions The Smart Way](http://catb.org/esr/faqs/smart-questions.html)
* [Writing the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)
* [Question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/)
* [Could you please make my preference the default?](https://www.qubes-os.org/faq/#could-you-please-make-my-preference-the-default)

<!--
If it doesn't affect a large user base, you will have more chance to get our
Expand Down
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/feat.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ assignees: ''

I confirm that I have read the following resources:

- [How to contribute to Qusal](https://github.com/ben-grande/qusal/blob/main/docs/CONTRIBUTE.md)
- [How Qusal is designed](https://github.com/ben-grande/qusal/blob/main/docs/DESIGN.md)
- [How to ask questions The Smart Way](http://catb.org/esr/faqs/smart-questions.html)
- [Writing the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)
- [Question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/)
- [Could you please make my preference the default?](https://www.qubes-os.org/faq/#could-you-please-make-my-preference-the-default)
* [How to contribute to Qusal](https://github.com/ben-grande/qusal/blob/main/docs/CONTRIBUTE.md)
* [How Qusal is designed](https://github.com/ben-grande/qusal/blob/main/docs/DESIGN.md)
* [How to ask questions The Smart Way](http://catb.org/esr/faqs/smart-questions.html)
* [Writing the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)
* [Question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/)
* [Could you please make my preference the default?](https://www.qubes-os.org/faq/#could-you-please-make-my-preference-the-default)

<!--
If it doesn't affect a large user base, you will have more chance to get our
Expand Down
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ assignees: ''

I confirm that I have read the following resources:

- [How to troubleshoot Qusal](https://github.com/ben-grande/qusal/blob/main/docs/TROUBLESHOOT.md)
- [How to ask questions The Smart Way](http://catb.org/esr/faqs/smart-questions.html)
- [Writing the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)
- [Question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/)
- [Could you please make my preference the default?](https://www.qubes-os.org/faq/#could-you-please-make-my-preference-the-default)
* [How to troubleshoot Qusal](https://github.com/ben-grande/qusal/blob/main/docs/TROUBLESHOOT.md)
* [How to ask questions The Smart Way](http://catb.org/esr/faqs/smart-questions.html)
* [Writing the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)
* [Question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/)
* [Could you please make my preference the default?](https://www.qubes-os.org/faq/#could-you-please-make-my-preference-the-default)

<!--
If it doesn't affect a large user base, you will have more chance to get our
Expand Down
16 changes: 8 additions & 8 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

Before contributing, I, the opener of this request:

- [ ] Agree to use the same license of each modified file;
- [ ] Have followed the [contribution guidelines](docs/CONTRIBUTE.md);
- [ ] Have tested it locally;
- [ ] Have committed locally and not through a git hosting service such as
GitHub Web; and
- [ ] Have reviewed and updated any documentation if relevant.
- [ ] Agree to use the same license of each modified file;
- [ ] Have followed the [contribution guidelines](docs/CONTRIBUTE.md);
- [ ] Have tested it locally;
- [ ] Have committed locally and not through a git hosting service such as
GitHub Web; and
- [ ] Have reviewed and updated any documentation if relevant.

Lacking to check any of the above can result in the rejection of the
contribution without no further comment.

## What does this PR aims to accomplish?
## What does this PR aims to accomplish



## What does this PR change?
## What does this PR change
<!-- Issues must be referenced if they exist
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests
-->
Expand Down
29 changes: 25 additions & 4 deletions scripts/markdown-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ command -v git >/dev/null ||
cd "$(git rev-parse --show-toplevel)" || exit 1
./scripts/requires-program.sh mdl

extra_files_rules="~MD002,~MD012,~MD022,~MD032,~MD041"

find_tool="find"
if command -v fd; then
find_tool="fd"
Expand All @@ -21,21 +23,40 @@ fi

if test -n "${1-}"; then
files=""
extra_files=""
for f in "$@"; do
test -f "$f" || continue
extension="${f##*.}"
case "$extension" in
md) files="$files $f";;
*) continue;;
md)
case "${f}" in
.github/*) extra_files="$extra_files $f"; continue;;
esac
files="$files $f";;
*)
continue
;;
esac
done
if test -n "${extra_files}"; then
mdl --rules ${extra_files_rules} ${extra_files}
fi
test -n "$files" || exit 0
exec mdl ${files}
fi

case "${find_tool}" in
fd|fdfind) files="$(${find_tool} . --extension=md)";;
find) files="$(find minion.d/ -type f -name "*.md")";;
fd|fdfind)
files="$(${find_tool} . --hidden --exclude .github --type=f --extension=md)"
extra_files="$(${find_tool} . --hidden --type=f --extension=md .github)"
;;
find)
files="$(find . -not -path './.github/*' -type f -name "*.md")"
extra_files="$(find .github -type f -name "*.md")"
;;
esac

if test -n "${extra_files}"; then
mdl --rules ${extra_files_rules} ${extra_files}
fi
exec mdl ${files}

0 comments on commit 2a4b453

Please sign in to comment.