Skip to content

Move npm-check commands from style-guide.md to pr-checks.md #7191

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions content/en/docs/contributing/pr-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,19 @@ issues. Run `npm run check:text` again and manually fix the remaining issues.
This check verifies that
[standards and consistency for Markdown files are enforced](../style-guide/#markdown-standards).

If any issues are found, run `npm run fix:format` to fix most issues. For more
complex issues, run `npm run check:markdown` and apply the suggested changes.
If any issues are found, run `npm run fix:markdown` to fix most issues
automatically. For any remaining issues, run `npm run check:markdown` and apply
the suggested changes manually.

### `SPELLING check` {.notranslate lang=en}

This check verifies that
[all words are spelled correctly](../style-guide/#spell-checking).

If this check fails, run `npm run check:spelling` locally to see the misspelled
words. If a word is spelled correctly, you may need to add it to the
`cSpell:ignore` section in the front matter of the file.

### `CSPELL` check {.notranslate lang=en}

This check will verify that all words in your cSpell ignore list are normalized.
Expand Down
36 changes: 9 additions & 27 deletions content/en/docs/contributing/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,12 @@ are properly written and use the original capitalization. For example, write
[`.textlintrc.yml`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.textlintrc.yml)
file.

{{% alert title="Tip" %}}

Run `npm run check:text` to verify that all terms and words are written
properly.

Run `npm run check:text -- --fix` to fix terms and words that are not written
properly.

{{% /alert %}}

## Markdown standards

To enforce standards and consistency for Markdown files, all files should follow
certain rules, enforced by [markdownlint]. For a full list, check the
[.markdownlint.json] file.

Run:

- `npm run check:markdown` to ensure that all files follow our standards
- `npm run fix:markdown` to fix Markdown-related formatting issues

We also enforce Markdown [file format](#file-format) and strip files of trailing
whitespace. This precludes the [line break syntax] of 2+ spaces; use `<br>`
instead or reformat your text.
Expand All @@ -80,11 +65,10 @@ OpenTelemetry website, see the
[`.cspell.yml`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.cspell.yml)
file.

Run `npm run check:spelling` to verify that all your words are spelled
correctly. If `cspell` indicates an `Unknown word` error, verify if you wrote
that word correctly. If so, add this word to the `cSpell:ignore` section at the
top of your file. If no such section exists, you can add it to the front matter
of a Markdown file:
If `cspell` indicates an `Unknown word` error, verify if you wrote that word
correctly. If so, add this word to the `cSpell:ignore` section at the top of
your file. If no such section exists, you can add it to the front matter of a
Markdown file:

```markdown
---
Expand All @@ -102,11 +86,6 @@ might look like this:
title: registryEntryTitle
```

Website tooling normalizes page-specific dictionaries (that is, the
`cSpell:ignore` word lists), by removing duplicate words, deleting words in the
global word list, and sorting words. To normalize page-specific dictionaries,
run `npm run fix:dict`.

## File format

We enforce file formatting using [Prettier]. Invoke it using
Expand All @@ -115,8 +94,11 @@ We enforce file formatting using [Prettier]. Invoke it using
## File names

All file names should be in
[kebab case](https://en.wikipedia.org/wiki/Letter_case#Kebab_case). Run
`npm run fix:filenames` to automatically rename your files.
[kebab case](https://en.wikipedia.org/wiki/Letter_case#Kebab_case).

## Fixing validation issues

To learn how to fix validation issues, see [Pull request checks](../pr-checks).

[.markdownlint.json]:
https://github.com/open-telemetry/opentelemetry.io/blob/main/.markdownlint.json
Expand Down