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

chore(lint): refactor Markdown linting to use markdownlint-cli2 #2234

Merged
merged 10 commits into from
May 30, 2024
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/plugin_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate


### Do you expect this instrumentation to be commonly used?

Weekly Downloads:

### What version of instrumentation are you interested in using?

Versions:

### Additional context
Expand Down
5 changes: 0 additions & 5 deletions .github/markdown-lint.yml

This file was deleted.

12 changes: 3 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@ jobs:
with:
node-version: 18
cache: 'npm'

- name: Lint markdown files
uses: avto-dev/markdown-lint@v1
with:
config: '.github/markdown-lint.yml'
ignore: "./**/CHANGELOG.md"
args: "./**/*.md"

- run: npm ci
- name: Lint
run: npm run lint
run: |
npm run lint
npm run lint:markdown
16 changes: 16 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc
{
"config": {
// https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases
"MD013": false,
"MD024": false,
"MD033": false,
"MD041": false,
// XXX Rules to discuss:
"MD012": false // no-multiple-blanks, common in CHANGELOG.md files, ~1700 hits in changelog files
// "MD004": { "style": "dash" } // ul-style, ~3800 hits in 63 changelog files, XXX discuss just using "consistent" new default for dash
Copy link
Contributor Author

@trentm trentm May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blumamir I'd like to discuss these two rules.

"MD012": false

This is not disabled in the core repo. If re-enabled in the contrib repo here, there are approximately 1700 hits (a) in most of the 63 CHANGELOG.md files and (b) a few hits in these files:

   1 plugins/node/opentelemetry-instrumentation-mysql/README.md
   3 .github/ISSUE_TEMPLATE/plugin_request.md
   4 .github/ISSUE_TEMPLATE/feature_request.md
   6 .github/ISSUE_TEMPLATE/bug_report.md

I think the cases in the CHANGELOG.md files will just keep happening because they are generated by release-please, we do not want this rule enabled for them. There are two options:

  1. globally disable the rule in this config file
  2. locally disable the rule for each CHANGELOG.md file. This is slightly burdensome (just a onetime edit) because there are 63 changelog files.

Thoughts?

MD004

Earlier we changed to style: "dash" to prefer dashes for bullets. In the core repo we disabled this rule locally in the 2 changelog files. Options:

  1. Disable it locally in the 63 changelog files -- similar to how we did in the core repo.
  2. Use the newer default of "consistent", which ensures that each file is consistent in the bullets it uses. That means the rule could apply to CHANGELOG.md files as well, but would enforce consistent * usage.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the cases in the CHANGELOG.md files will just keep happening because they are generated by release-please, we do not want this rule enabled for them. There are two options:

  1. globally disable the rule in this config file
  2. locally disable the rule for each CHANGELOG.md file. This is slightly burdensome (just a onetime edit) because there are 63 changelog files.

Thoughts?

Another alternative would be to use 2 markdown configs, one for CHANGELOG and one for other markdowns. I don't mind disabling it across the repo, but could be nice to have it if not too complex.

Earlier we changed to style: "dash" to prefer dashes for bullets. In the core repo we disabled this rule locally in the 2 changelog files. Options:

If we have different config file for CHANGELOGs than this is addressed as well, but if not straight-forward than we can disable it locally in each file or use the "consistent" option. What ever is easier and makes more sense to you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to not have two separate config files, because:

  • it would be more likely for those config files to diverge,
  • it is a little messy to have yet another config file at the top,
  • it will mean markdownlint editor plugins (like the VSCode one referred to above) won't work properly -- the plugin will just use the default .markdownlint-cli2.jsonc file

In commit 2e03f59 I've opted to avoid <!-- markdownlist-disable ... --> directives in every CHANGELOG.md file by selecting options that work for all .md files. That means ul-style: consistent and no-multiple-blanks: false.

(A personal preference note: I like using multiple blank lines sometimes, both in Markdown and code, to separate bigger sections vs. a single line for related blocks. So I was never a fan of no-multiple-blank lines and the eslint equivalent in code.)

},
"gitignore": true,
"noBanner": true,
"noProgress": true
}
7 changes: 0 additions & 7 deletions .markdownlint.json

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- markdownlint-disable -->
# CHANGELOG

As of v0.25.1 (2022-01-24) changelog content has moved to separate CHANGELOG.md files for each package. Use [this search for a list of all CHANGELOG.md files in this repo](https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-js-contrib+path%3A**%2FCHANGELOG.md&type=code).
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ With the exception of the stable status, it is up to each individual [component
A component may only be marked stable with the approval of a member of @open-telemetry/javascript-maintainers; see the definition of stable below for more details.

A Pull Request modifying components in any stage of the lifecycle is subject to the
[Pull Request Merge Requirements](#pull-request-merge-requirements).
[Pull Request Merge Guidelines](#pull-request-merge-guidelines).

### Unreleased

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</a>
<br/>
<a href="https://github.com/open-telemetry/opentelemetry-js-contrib/actions/workflows/test-all-versions.yml">
<img src="https://github.com/open-telemetry/opentelemetry-js-contrib/actions/workflows/test-all-versions.yml/badge.svg">
<img alt="test-all-versions badge" src="https://github.com/open-telemetry/opentelemetry-js-contrib/actions/workflows/test-all-versions.yml/badge.svg">
</a>
<img alt="Beta" src="https://img.shields.io/badge/status-beta-informational?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdp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vwCC5/5fcV4vo3+3LpMdtWHh0ywsJC/ZGoCb8/9D8F/ifgLLl8S8QWfU8cAAAAASUVORK5CYII=">
</p>
Expand Down Expand Up @@ -74,7 +74,7 @@ We'd love your help! Use tags [up-for-grabs][up-for-grabs-issues] and [good firs
### Thanks to all the people who already contributed

<a href="https://github.com/open-telemetry/opentelemetry-js-contrib/graphs/contributors">
<img src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-js-contrib" />
<img alt="contributors" src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-js-contrib" />
</a>

## Useful links
Expand Down
Original file line number Diff line number Diff line change
@@ -1,77 +1,5 @@
# Changelog

### Dependencies
blumamir marked this conversation as resolved.
Show resolved Hide resolved

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.30.0 to ^0.31.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.31.0 to ^0.32.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.0 to ^0.33.1

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.1 to ^0.33.2

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.3 to ^0.33.4

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.1 to ^0.34.2

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.2 to ^0.34.3

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.3 to ^0.35.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.35.0 to ^0.35.1

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.35.1 to ^0.36.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.36.0 to ^0.37.0

## [0.28.9](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-alibaba-cloud-v0.28.8...resource-detector-alibaba-cloud-v0.28.9) (2024-04-25)


Expand Down
66 changes: 0 additions & 66 deletions detectors/node/opentelemetry-resource-detector-aws/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,5 @@
# Changelog

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.30.0 to ^0.31.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.31.0 to ^0.32.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.0 to ^0.33.1

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.1 to ^0.33.2

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.3 to ^0.33.4

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.1 to ^0.34.2

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.2 to ^0.34.3

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.3 to ^0.35.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.35.0 to ^0.35.1

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.35.1 to ^0.36.0

## [1.5.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-aws-v1.4.2...resource-detector-aws-v1.5.0) (2024-05-15)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# Changelog

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.35.1 to ^0.36.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.36.0 to ^0.37.0

## [0.2.7](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-azure-v0.2.6...resource-detector-azure-v0.2.7) (2024-04-25)


Expand Down Expand Up @@ -84,7 +72,7 @@
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.1 to ^0.34.3

## [0.1.0]() ()
## 0.1.0

### Features

Expand Down
10 changes: 10 additions & 0 deletions detectors/node/opentelemetry-resource-detector-azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,13 @@ This package implements Semantic Convention [Version 1.19.0](https://github.com/
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]

## License

Apache 2.0 - See [LICENSE][license-url] for more information.

[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@opentelemetry/resource-detector-azure
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fresource-detector-azure.svg
Original file line number Diff line number Diff line change
@@ -1,65 +1,5 @@
# Changelog

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.30.0 to ^0.31.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.0 to ^0.33.1

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.1 to ^0.33.2

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.33.3 to ^0.33.4

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.2 to ^0.34.3

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.34.3 to ^0.35.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.35.0 to ^0.35.1

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.35.1 to ^0.36.0

### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.36.0 to ^0.37.0

## [0.3.9](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-container-v0.3.8...resource-detector-container-v0.3.9) (2024-04-25)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@opentelemetry/resource-detector-container
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fresource-detector-container.svg
Loading
Loading