🧹 Use git diff --check as another linter

This commit is contained in:
Chris Araman 2021-03-21 19:17:28 -07:00
parent 05083da253
commit fc33738f0f
No known key found for this signature in database
GPG key ID: BB4499D9E11B61E0
4 changed files with 10 additions and 5 deletions

4
.gitattributes vendored Normal file
View file

@ -0,0 +1,4 @@
# Trailing spaces may be intentional in markdown documents, so these should not
# be removed.
# https://gist.github.com/shaunlebron/746476e6e7a4d698b373
**/*.md whitespace=-blank-at-eol

View file

@ -23,9 +23,7 @@ We love pull requests from everyone. By participating in this project, you agree
`git checkout -b awesome-feature master` `git checkout -b awesome-feature master`
- Please avoid working [directly on the master branch](https://softwareengineering.stackexchange.com/questions/223400/when-should-i-stop-committing-to-master-on-new-projects). - Please avoid working [directly on the master branch](https://softwareengineering.stackexchange.com/questions/223400/when-should-i-stop-committing-to-master-on-new-projects).
- Make commits of logical units. - Make commits of logical units.
- Check for unnecessary whitespace with `git diff --check` before committing. - Run script/lint before committing your changes. Fix anything that isn't automatically fixed by the linters.
- Note that [two trailing spaces](https://gist.github.com/shaunlebron/746476e6e7a4d698b373) is intentional
in markdown documents to create a line break like `<br>`, so these should _not_ be removed.
- Push your topic branch to your fork and [submit a pull request](https://github.com/mas-cli/mas/compare/master...your-username:topic-branch). - Push your topic branch to your fork and [submit a pull request](https://github.com/mas-cli/mas/compare/master...your-username:topic-branch).
Some things that will increase the chance that your pull request is accepted: Some things that will increase the chance that your pull request is accepted:

View file

@ -1,7 +1,7 @@
# All Files # All Files
- Remove unnecessary whitespace from the end of lines. - Remove unnecessary whitespace from the end of lines.
- Use `git diff --check` to look for these before committing. - Use `script/lint` to look for these before committing.
- Note that [two trailing spaces](https://gist.github.com/shaunlebron/746476e6e7a4d698b373) - Note that [two trailing spaces](https://gist.github.com/shaunlebron/746476e6e7a4d698b373)
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).

View file

@ -3,11 +3,14 @@
# script/lint # script/lint
# mas # mas
# #
# Linting checks for CI "Lint" stage. # Linting checks for development and CI.
# #
echo "==> 🚨 Linting mas" echo "==> 🚨 Linting mas"
echo "--> 🌳 Git"
git diff --check
echo echo
echo "--> 🕊️ Swift" echo "--> 🕊️ Swift"
swiftlint lint --strict swiftlint lint --strict