Skip to content

Commit

Permalink
🧹 Use git diff --check as another linter
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-araman committed Mar 28, 2021
1 parent 05083da commit fc33738
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
@@ -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
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Expand Up @@ -23,9 +23,7 @@ We love pull requests from everyone. By participating in this project, you agree
`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).
- Make commits of logical units.
- Check for unnecessary whitespace with `git diff --check` before committing.
- 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.
- Run script/lint before committing your changes. Fix anything that isn't automatically fixed by the linters.
- 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:
Expand Down
2 changes: 1 addition & 1 deletion docs/style.md
@@ -1,7 +1,7 @@
# All Files

- 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)
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).
Expand Down
5 changes: 4 additions & 1 deletion script/lint
Expand Up @@ -3,11 +3,14 @@
# script/lint
# mas
#
# Linting checks for CI "Lint" stage.
# Linting checks for development and CI.
#

echo "==> 🚨 Linting mas"

echo "--> 🌳 Git"
git diff --check

echo
echo "--> 🕊️ Swift"
swiftlint lint --strict
Expand Down

0 comments on commit fc33738

Please sign in to comment.