🖊 Lint markdown

This commit is contained in:
Chris Araman 2021-05-03 13:42:10 -07:00
parent 9277a8b7cc
commit 2bc19e3b9b
No known key found for this signature in database
GPG key ID: BB4499D9E11B61E0
9 changed files with 55 additions and 41 deletions

View file

@ -26,8 +26,6 @@ assignees: ''
> A clear and concise description of what the bug is. > A clear and concise description of what the bug is.
## To Reproduce ## To Reproduce
Steps to reproduce the behavior: Steps to reproduce the behavior:
@ -41,29 +39,20 @@ Steps to reproduce the behavior:
> A clear and concise description of what you expected to happen. > A clear and concise description of what you expected to happen.
## Actual Behavior ## Actual Behavior
> A clear and concise description of what actually happened. > A clear and concise description of what actually happened.
## Screenshots, Terminal Output ## Screenshots, Terminal Output
> If applicable, add screenshots to help explain your problem. > If applicable, add screenshots to help explain your problem.
```bash
```
$ mas command $ mas command
... ...
``` ```
## Additional Context ## Additional Context
> Add any other context about the problem here. > Add any other context about the problem here.
> Did it work in a previous version? > Did it work in a previous version?

4
.markdownlint.json Normal file
View file

@ -0,0 +1,4 @@
{
"MD013": { "line_length": 120 },
"MD033": { "allowed_elements": ["h1", "img"] }
}

View file

@ -1,3 +1,4 @@
brew "markdownlint-cli"
brew "shfmt" brew "shfmt"
brew "swift-format" brew "swift-format"
brew "swiftformat" brew "swiftformat"

View file

@ -68,9 +68,9 @@ members of the project's leadership.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
[homepage]: https://www.contributor-covenant.org [homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq <https://www.contributor-covenant.org/faq>

View file

@ -6,7 +6,9 @@ We love pull requests from everyone. By participating in this project, you agree
- Make sure you have a [GitHub account](https://github.com/join). - Make sure you have a [GitHub account](https://github.com/join).
- [Open an issue](https://github.com/mas-cli/mas/issues/new) to simply ask a question or request a new feature. - [Open an issue](https://github.com/mas-cli/mas/issues/new) to simply ask a question or request a new feature.
- Search for similar issues with the [ERROR MESSAGE](https://github.com/mas-cli/mas/issues?utf8=%E2%9C%93&q=is%3Aopen+ERROR+MESSAGE) you are exeriencing. - Search for similar issues with the
[ERROR MESSAGE](https://github.com/mas-cli/mas/issues?utf8=%E2%9C%93&q=is%3Aopen+ERROR+MESSAGE)
you are exeriencing.
- If one doesn't exist, [open a new issue](https://github.com/mas-cli/mas/issues/new) - If one doesn't exist, [open a new issue](https://github.com/mas-cli/mas/issues/new)
- Clearly describe the issue including steps to reproduce when it is a bug. - Clearly describe the issue including steps to reproduce when it is a bug.
- Include the earliest version of `mas` that you know has the issue. - Include the earliest version of `mas` that you know has the issue.
@ -50,7 +52,8 @@ to this project, but must remain an owner. By becoming a contributor, you agree
- This project follows [trunk-based development](https://trunkbaseddevelopment.com/), where `master` is our trunk. - This project follows [trunk-based development](https://trunkbaseddevelopment.com/), where `master` is our trunk.
- Release commits will be tagged in the format: `v1.2.3`. - Release commits will be tagged in the format: `v1.2.3`.
- Once releases are tagged, high-level release notes are published on the [releases](https://github.com/mas-cli/mas/releases) page. - Once releases are tagged, high-level release notes are published on the
[releases](https://github.com/mas-cli/mas/releases) page.
See GitHub's post on creating [Contributing Guidelines](https://github.com/blog/1184-contributing-guidelines) See GitHub's post on creating [Contributing Guidelines](https://github.com/blog/1184-contributing-guidelines)
if you would like to set up something like this for your projects. if you would like to set up something like this for your projects.

View file

@ -1,4 +1,4 @@
[<p align="center"><img src="mas-cli.png" alt="mas-cli" width="450" height="auto"></p>][mas-cli] <h1 align="center"><img src="mas-cli.png" alt="mas-cli" width="450" height="auto"></h1>
# mas-cli # mas-cli
@ -109,7 +109,8 @@ $ mas purchase 768053424
``` ```
> Please note that you may have to re-authenticate yourself in the App Store to complete the purchase. > Please note that you may have to re-authenticate yourself in the App Store to complete the purchase.
This is the case if the application is not free or if you configured your account not to remember the credentials for free purchases. This is the case if the application is not free or if you configured your account not to remember the
credentials for free purchases.
Use `mas outdated` to list all applications with pending updates. Use `mas outdated` to list all applications with pending updates.
@ -183,9 +184,14 @@ docs for more details.
## 💥 When something doesn't work ## 💥 When something doesn't work
If you see the error "This redownload is not available for this Apple ID either because it was bought by a different user of the item was refunded or cancelled.", it's probably because you haven't installed the app through the App Store yet. See [#46](https://github.com/mas-cli/mas/issues/46#issuecomment-248581233). If you see this error, it's probably because you haven't installed the app through the App Store yet.
See [#46](https://github.com/mas-cli/mas/issues/46#issuecomment-248581233).
> This redownload is not available for this Apple ID either because it was bought by a different user of the
> item was refunded or cancelled.
If `mas` doesn't work for you as expected (e.g. you can't update/download apps), run `mas reset` and try again. If the issue persists, please [file a bug](https://github.com/mas-cli/mas/issues/new)! All your feedback is much appreciated ✨ If `mas` doesn't work for you as expected (e.g. you can't update/download apps), run `mas reset` and try again.
If the issue persists, please [file a bug](https://github.com/mas-cli/mas/issues/new).
All your feedback is much appreciated! ✨
## 📺 Using `tmux` ## 📺 Using `tmux`

View file

@ -7,13 +7,16 @@
is intentional in markdown documents to create a line break like `<br>`, so these should _not_ be removed. is intentional in markdown documents to create a line break like `<br>`, so these should _not_ be removed.
- End each file with a [newline character](https://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file#18789). - End each file with a [newline character](https://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file#18789).
# Swift ## Swift
[Sample](sample.swift) [Sample](sample.swift)
- Avoid [force unwrapping optionals](https://blog.timac.org/2017/0628-swift-banning-force-unwrapping-optionals/) with `!` in production code - Avoid [force unwrapping optionals](https://blog.timac.org/2017/0628-swift-banning-force-unwrapping-optionals/)
- Production code is what gets shipped with the app. Basically, everything under the [`mas-cli/`](https://github.com/mas-cli/mas/tree/master/mas-cli) folder. with `!` in production code
- However, force unwrapping is **encouraged** in tests for less code and tests _should_ break when any expected conditions aren't met. - Production code is what gets shipped with the app. Basically, everything under the
[`mas-cli/`](https://github.com/mas-cli/mas/tree/master/mas-cli) folder.
- However, force unwrapping is **encouraged** in tests for less code and tests
_should_ break when any expected conditions aren't met.
- Prefer `struct`s over `class`es wherever possible - Prefer `struct`s over `class`es wherever possible
- Default to marking classes as `final` - Default to marking classes as `final`
- Prefer protocol conformance to class inheritance - Prefer protocol conformance to class inheritance

View file

@ -13,13 +13,17 @@
echo "==> 🚨 Formatting mas" echo "==> 🚨 Formatting mas"
for LINTER in shfmt swift-format swiftformat swiftlint; do for LINTER in markdownlint shfmt swift-format swiftformat swiftlint; do
if [[ ! -x "$(command -v ${LINTER})" ]]; then if [[ ! -x "$(command -v ${LINTER})" ]]; then
echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'." echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'."
exit 1 exit 1
fi fi
done done
echo
echo "--> 🖊 Markdown"
markdownlint --config .markdownlint.json --fix .github .
echo echo
echo "--> 🕊️ Swift" echo "--> 🕊️ Swift"
for SOURCE in Package.swift Sources Tests; do for SOURCE in Package.swift Sources Tests; do

View file

@ -12,7 +12,7 @@
echo "==> 🚨 Linting mas" echo "==> 🚨 Linting mas"
for LINTER in git swift-format swiftformat swiftlint; do for LINTER in git markdownlint shfmt swift-format swiftformat swiftlint; do
if [[ ! -x "$(command -v ${LINTER})" ]]; then if [[ ! -x "$(command -v ${LINTER})" ]]; then
echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'." echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'."
exit 1 exit 1
@ -22,6 +22,10 @@ done
echo "--> 🌳 Git" echo "--> 🌳 Git"
git diff --check git diff --check
echo
echo "--> 🖊 Markdown"
markdownlint --config .markdownlint.json .github .
echo echo
echo "--> 🕊️ Swift" echo "--> 🕊️ Swift"
for SOURCE in Package.swift Sources Tests; do for SOURCE in Package.swift Sources Tests; do