Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: installation-agnostic prettier usage #2279

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -111,21 +111,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
Loading