Skip to content

Commit

Permalink
Docs: installation-agnostic prettier usage (#2279)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Oct 10, 2024
1 parent 7d51f23 commit b9d2abd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: List npm dependencies
run: npm ls --all
- name: Run prettier formatting
run: npx prettier . --check
run: npx prettier --check .
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
cancel-in-progress: true
14 changes: 2 additions & 12 deletions docs/user/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,11 @@ Mypy won't fix your code for you, but will warn you about potential issues with
If you've never used mypy before or aren't familiar with `Python type hints <https://docs.python.org/3/library/typing.html>`_, this check can be particularly daunting. Don't hesitate to ask for help with resolving any of these warnings on your pull request.

Prettier is a code formatter that helps to ensure consistent code style across a project. It supports various languages. Follow these steps to install Prettier:

1. Install Node.js: Prettier is a Node.js module, so you need to have Node.js installed on your system. You can download and install Node.js from the `Node.js official website <https://nodejs.org/en>`_.
2. Install Prettier: Use the following command to install the Prettier module in your project:

.. code-block:: console
$ npm install prettier --no-save
3. Run Prettier: Use the following command to run Prettier formating:
Prettier is a code formatter that helps to ensure consistent code style across a project. It supports various languages.

.. code-block:: console
$ npx prettier . --write
$ prettier --write .
You can also use `git pre-commit hooks <https://pre-commit.com/>`_ to automatically run these checks before each commit. pre-commit is a tool that automatically runs linters locally, so that you don't have to remember to run them manually and then have your code flagged by CI. You can set up pre-commit with:
Expand Down

0 comments on commit b9d2abd

Please sign in to comment.