Skip to content

Commit

Permalink
Add prettier pre-commit
Browse files Browse the repository at this point in the history
Format Markdown and YAML with prettier
  • Loading branch information
jbampton committed Jun 23, 2021
1 parent e638271 commit 300cb1e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---

extends: default

rules:
comments: disable
document-start: disable
line-length: disable
truthy: false
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
- name: Misspell
run: git ls-files --empty-directory | xargs ./misspell -error
pre-commit:
name: Run pre-commit # https://pre-commit.com/
name: Run pre-commit # https://pre-commit.com/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://www.python.org/
- uses: actions/setup-python@v2 # https://www.python.org/
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies # https://pip.pypa.io/en/stable/
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies # https://pip.pypa.io/en/stable/
run: |
python -m pip install --upgrade pip
pip install pre-commit
Expand Down
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_stages: [commit, push]
default_language_version:
# force all unspecified Python hooks to run python3
python: python3
minimum_pre_commit_version: "1.20.0"
minimum_pre_commit_version: '1.20.0'
repos:
- repo: meta
hooks:
Expand Down Expand Up @@ -35,16 +35,24 @@ repos:
name: Run codespell
description: Check spelling with codespell
entry: codespell --ignore-words=codespell.txt
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.1
hooks:
- id: prettier
name: Run prettier
description: Format files with prettier
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.27.1
hooks:
- id: markdownlint
name: Run markdownlint
description: Check all Markdown files with markdownlint
entry: markdownlint -c .github/linters/.markdown-lint.yml .
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.1
hooks:
- id: yamllint
name: Check YAML files with yamllint
name: Run yamllint
description: Check YAML files with yamllint
entry: yamllint --strict -c .github/linters/.yaml-lint.yml .
types: [yaml]
2 changes: 2 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
semi: true
singleQuote: true
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
script: "./.check.rb"
script: './.check.rb'
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ To run a single hook use `pre-commit run --all-files <hook_id>`

To update use `pre-commit autoupdate`

* [Quick start](https://pre-commit.com/#quick-start)
* [Usage](https://pre-commit.com/#usage)
* [pre-commit-autoupdate](https://pre-commit.com/#pre-commit-autoupdate)
- [Quick start](https://pre-commit.com/#quick-start)
- [Usage](https://pre-commit.com/#usage)
- [pre-commit-autoupdate](https://pre-commit.com/#pre-commit-autoupdate)
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A list of all GEMs for mruby to be managed by mgem
If you want to add your own mruby GEM to this list please
create a pull request with your GEM details.

* [CONTRIBUTING.md](CONTRIBUTING.md)
- [CONTRIBUTING.md](CONTRIBUTING.md)

## Example

Expand All @@ -29,8 +29,8 @@ repository: https://github.com/the/address/to/the/gem.git

When creating a new GEM please consider:

* the name should express the functionality of the GEM clearly
* words should be separated by using dash (-)
* don't use *under_score* and *CamelCase*
* prefix should be *mruby-*
* if it's an executable, prefix should be *mruby-bin-*
- the name should express the functionality of the GEM clearly
- words should be separated by using dash (-)
- don't use _under_score_ and _CamelCase_ <!-- markdownlint-disable MD037 -->
- prefix should be _mruby-_
- if it's an executable, prefix should be _mruby-bin-_

0 comments on commit 300cb1e

Please sign in to comment.