mirror of
https://github.com/mas-cli/mas
synced 2024-12-11 20:52:35 +00:00
🖊 Lint markdown
This commit is contained in:
parent
9277a8b7cc
commit
2bc19e3b9b
9 changed files with 55 additions and 41 deletions
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -26,8 +26,6 @@ assignees: ''
|
|||
|
||||
> A clear and concise description of what the bug is.
|
||||
|
||||
|
||||
|
||||
## To Reproduce
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
## Actual Behavior
|
||||
|
||||
> A clear and concise description of what actually happened.
|
||||
|
||||
|
||||
|
||||
## Screenshots, Terminal Output
|
||||
|
||||
> If applicable, add screenshots to help explain your problem.
|
||||
|
||||
|
||||
|
||||
```
|
||||
```bash
|
||||
$ mas command
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
## Additional Context
|
||||
|
||||
> Add any other context about the problem here.
|
||||
> Did it work in a previous version?
|
||||
|
||||
|
||||
|
|
4
.markdownlint.json
Normal file
4
.markdownlint.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"MD013": { "line_length": 120 },
|
||||
"MD033": { "allowed_elements": ["h1", "img"] }
|
||||
}
|
1
Brewfile
1
Brewfile
|
@ -1,3 +1,4 @@
|
|||
brew "markdownlint-cli"
|
||||
brew "shfmt"
|
||||
brew "swift-format"
|
||||
brew "swiftformat"
|
||||
|
|
|
@ -68,9 +68,9 @@ members of the project's leadership.
|
|||
## Attribution
|
||||
|
||||
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
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
<https://www.contributor-covenant.org/faq>
|
||||
|
|
|
@ -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).
|
||||
- [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)
|
||||
- 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.
|
||||
|
@ -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.
|
||||
- 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)
|
||||
if you would like to set up something like this for your projects.
|
||||
|
|
14
README.md
14
README.md
|
@ -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
|
||||
|
||||
|
@ -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.
|
||||
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.
|
||||
|
||||
|
@ -183,9 +184,14 @@ docs for more details.
|
|||
|
||||
## 💥 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`
|
||||
|
||||
|
|
|
@ -7,13 +7,16 @@
|
|||
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).
|
||||
|
||||
# Swift
|
||||
## Swift
|
||||
|
||||
[Sample](sample.swift)
|
||||
|
||||
- Avoid [force unwrapping optionals](https://blog.timac.org/2017/0628-swift-banning-force-unwrapping-optionals/) with `!` in production code
|
||||
- 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.
|
||||
- Avoid [force unwrapping optionals](https://blog.timac.org/2017/0628-swift-banning-force-unwrapping-optionals/)
|
||||
with `!` in production code
|
||||
- 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
|
||||
- Default to marking classes as `final`
|
||||
- Prefer protocol conformance to class inheritance
|
||||
|
|
|
@ -13,13 +13,17 @@
|
|||
|
||||
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
|
||||
echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
echo "--> 🖊 Markdown"
|
||||
markdownlint --config .markdownlint.json --fix .github .
|
||||
|
||||
echo
|
||||
echo "--> 🕊️ Swift"
|
||||
for SOURCE in Package.swift Sources Tests; do
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
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
|
||||
echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'."
|
||||
exit 1
|
||||
|
@ -22,6 +22,10 @@ done
|
|||
echo "--> 🌳 Git"
|
||||
git diff --check
|
||||
|
||||
echo
|
||||
echo "--> 🖊 Markdown"
|
||||
markdownlint --config .markdownlint.json .github .
|
||||
|
||||
echo
|
||||
echo "--> 🕊️ Swift"
|
||||
for SOURCE in Package.swift Sources Tests; do
|
||||
|
|
Loading…
Reference in a new issue