Skip to content

Commit d9b2972

Browse files
authored
chore: add markdown link & lint ci (#1684)
* feat: add markdwon link lint ci * update word
1 parent eed7060 commit d9b2972

File tree

25 files changed

+148
-62
lines changed

25 files changed

+148
-62
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Markdown Link Check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
markdown-link-check:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: "Markdown Link Check"
13+
uses: gaurav-nelson/github-action-markdown-link-check@v1
14+
with:
15+
config-file: '.markdown-link-check.json'
16+
use-quiet-mode: 'yes'
17+
use-verbose-mode: 'yes'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Markdown Lint Check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
markdownlint-check:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
# equivalent cli: markdownlint-cli2 "**/*.md" "#**/CHANGELOG.md" --config .markdownlint.json
13+
- name: "Markdown Lint Check"
14+
uses: DavidAnson/markdownlint-cli2-action@v16
15+
with:
16+
fix: false
17+
globs: |
18+
**/*.md
19+
!**/CHANGELOG.md
20+
continue-on-error: true

.markdown-link-check.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^http://localhost"
5+
}
6+
],
7+
"timeout": "5s",
8+
"retryOn429": true,
9+
"aliveStatusCodes": [200, 206, 429]
10+
}

.markdownlint.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"emphasis-style": false,
3+
"line-length": false,
4+
"link-fragments": false,
5+
"list-marker-space": false,
6+
"no-emphasis-as-heading": false,
7+
"no-hard-tabs": false,
8+
"no-inline-html": false,
9+
"no-trailing-punctuation": false,
10+
"no-trailing-spaces": true,
11+
"custom-rules-below-this-point": false,
12+
"trim-code-block-and-unindent": true
13+
}

CONTRIBUTING.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ conforms to the specification, but the interface and structure are flexible.
2424
It is preferable to have contributions follow the idioms of the language
2525
rather than conform to specific API names or argument patterns in the spec.
2626

27-
For a deeper discussion, see: https://github.com/open-telemetry/opentelemetry-specification/issues/165
27+
For a deeper discussion, see: <https://github.com/open-telemetry/opentelemetry-specification/issues/165>
2828

2929
## Getting started
3030

@@ -40,6 +40,7 @@ git clone git@github.com:YOUR_GITHUB_NAME/opentelemetry-ruby.git
4040
```
4141

4242
or
43+
4344
```sh
4445
git clone https://github.com/YOUR_GITHUB_NAME/opentelemetry-ruby.git
4546
```
@@ -66,11 +67,11 @@ _Setting up a running Ruby environment is outside the scope of this document._
6667

6768
This repository contains multiple Ruby gems:
6869

69-
* `opentelemetry-api` located in the `api` directory
70-
* `opentelemetry-sdk` located in the `sdk` directory
71-
* Various instrumentation gems located in subdirectories of `instrumentation`
72-
* Various exporter gems located in subdirectories of `exporter`
73-
* `opentelemetry-resource_detectors` located in the `resource_detectors` directory
70+
* `opentelemetry-api` located in the `api` directory
71+
* `opentelemetry-sdk` located in the `sdk` directory
72+
* Various instrumentation gems located in subdirectories of `instrumentation`
73+
* Various exporter gems located in subdirectories of `exporter`
74+
* `opentelemetry-resource_detectors` located in the `resource_detectors` directory
7475

7576
Each of these gems has its configuration and tests.
7677

@@ -89,10 +90,10 @@ configuration details.
8990

9091
The services provided include:
9192

92-
* `app` - main container environment scoped to the `/app` directory. Used
93+
* `app` - main container environment scoped to the `/app` directory. Used
9394
primarily to build and tag the `opentelemetry/opentelemetry-ruby:latest` image.
94-
* `api` - convenience environment scoped to the `api` gem in the `/app/api` directory.
95-
* `sdk` - convenience environment scoped to the `sdk` gem in the `/app/sdk` directory.
95+
* `api` - convenience environment scoped to the `api` gem in the `/app/api` directory.
96+
* `sdk` - convenience environment scoped to the `sdk` gem in the `/app/sdk` directory.
9697

9798
To test using Docker:
9899

@@ -154,8 +155,8 @@ to ensure that your code complies before opening a pull request.
154155
We also use Yard to generate class documentation automatically. Among other
155156
things, this means:
156157

157-
* Methods and arguments should include the appropriate type annotations
158-
* You can use markdown formatting in your documentation comments
158+
* Methods and arguments should include the appropriate type annotations
159+
* You can use markdown formatting in your documentation comments
159160

160161
You can generate the docs locally to see the results, by running:
161162

@@ -249,7 +250,7 @@ Releases are normally performed using GitHub Actions.
249250
* For each gem, it will create a release tag and a GitHub release.
250251
* It will build and push the gems to rubygems.
251252
* It will build the docs and push them to
252-
https://open-telemetry.github.io/opentelemetry-ruby
253+
<https://open-telemetry.github.io/opentelemetry-ruby>
253254
* If the releases succeed, the script will update the release pull
254255
request with the results and change its label to `release: complete`.
255256
If something went wrong, the script will, if possible, report the error
@@ -269,15 +270,15 @@ review the release logs for the GitHub Actions workflows.
269270

270271
There are four GitHub actions workflows related to releases.
271272

272-
* `Open release request` is the main release entrypoint, and is used to open
273+
* `Open release request` is the main release entrypoint, and is used to open
273274
a release pull request. If something goes wrong with this process, the logs
274275
will appear in the workflow run.
275-
* `Force release` is generally used only to restart a failed release.
276-
* `[release hook] Update open releases` is run on pushes to the main branch,
276+
* `Force release` is generally used only to restart a failed release.
277+
* `[release hook] Update open releases` is run on pushes to the main branch,
277278
and pushes warnings to open release pull requests if you make modifications
278279
before triggering the release (i.e. because you might need to update the
279280
changelogs.)
280-
* `[release hook] Process release` is the main release automation script and
281+
* `[release hook] Process release` is the main release automation script and
281282
is run when a pull request is closed. If it determines that a release pull
282283
request was merged, it kicks off the release process for the affected gems.
283284
It also updates the label on a closed release pull request. Finally, it
@@ -320,7 +321,7 @@ changed gems.
320321

321322
To force-release, assuming the version and changelog are already modified:
322323

323-
```
324+
```sh
324325
toys release perform --rubygems-api-key=$API_KEY $GEM_NAME $GEM_VERSION
325326
```
326327

@@ -338,17 +339,17 @@ not correspond exactly to the gem name.
338339

339340
For releases to succeed, new gems MUST include the following:
340341

341-
* The above configuration entry.
342-
* The `*.gemspec` file, with the name matching the gem name.
343-
* A `version.rb` file in the standard location, or in a location listed in
342+
* The above configuration entry.
343+
* The `*.gemspec` file, with the name matching the gem name.
344+
* A `version.rb` file in the standard location, or in a location listed in
344345
the configuration.
345-
* A `CHANGELOG.md` file.
346-
* A `yard` rake task.
346+
* A `CHANGELOG.md` file.
347+
* A `yard` rake task.
347348

348349
[cncf-cla]: https://identity.linuxfoundation.org/projects/cncf
349350
[github-draft]: https://github.blog/2019-02-14-introducing-draft-pull-requests/
350351
[kube-github-workflow-pr]: https://github.com/kubernetes/community/blob/master/contributors/guide/github-workflow.md#7-create-a-pull-request
351-
[otel-contributor-guide]: https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md
352-
[otel-github-workflow]: https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#github-workflow
352+
[otel-contributor-guide]: https://github.com/open-telemetry/community/blob/main/guides/contributor/README.md
353+
[otel-github-workflow]: https://github.com/open-telemetry/community/blob/main/guides/contributor/processes.md#workflows
353354
[otel-lib-guidelines]: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/library-guidelines.md
354355
[otel-specification]: https://github.com/open-telemetry/opentelemetry-specification

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ the [Ruby language](https://www.ruby-lang.org/en/downloads/branches/).
6363

6464
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
6565
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url].
66+
- For more examples, check [SDK example][examples-github].
6667

6768
## License
6869

api/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data should depend only on `opentelemetry-api`, deferring the choice of concrete
2121

2222
Install the gem using:
2323

24-
```
24+
```sh
2525
gem install opentelemetry-api
2626
```
2727

@@ -58,7 +58,6 @@ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special int
5858

5959
The `opentelemetry-api` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
6060

61-
6261
[opentelemetry-home]: https://opentelemetry.io
6362
[bundler-home]: https://bundler.io
6463
[repo-github]: https://github.com/open-telemetry/opentelemetry-ruby

common/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `opentelemetry-common` gem provides common helpers for semantic conventions,
1616

1717
Install the gem using:
1818

19-
```
19+
```sh
2020
gem install opentelemetry-common
2121
```
2222

examples/http/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ This is a simple example that demonstrates tracing an HTTP request from client t
1111
### Running the example
1212

1313
Install gems
14+
1415
```sh
1516
bundle install
1617
```
1718

1819
Start the server
20+
1921
```sh
2022
ruby server.rb
2123
```
2224

2325
In a separate terminal window, run the client to make a single request:
26+
2427
```sh
2528
ruby client.rb
2629
```
2730

2831
You should see console exporter output for both the client and server sessions.
29-

examples/metrics_sdk/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# OpenTelemetry Ruby Metrics SDK Example
22

3-
### metrics_collect.rb
3+
## metrics_collect.rb
44

55
Run the script to see the metric data from console
66

77
```sh
88
ruby metrics_collect.rb
99
```
1010

11-
### metrics_collect_otlp.rb
11+
## metrics_collect_otlp.rb
1212

1313
**WARN: this example doesn't work on alpine aarch64 container due to grpc installation issues.**
1414

1515
This example tests both the metrics sdk and the metrics otlp http exporter.
1616

1717
You can view the metrics in your favored backend (e.g. jaeger).
1818

19-
#### 1. Set up the local opentelemetry-collector.
19+
### 1. Set up the local opentelemetry-collector.
2020

2121
Given you have a `config.yml` file in your current directory and Docker is installed on your machine, run the following commands to pull the collector image and run the collector.
2222

@@ -56,17 +56,17 @@ service:
5656
5757
More information on how to setup the OTel collector can be found in the in [quick start docs](https://opentelemetry.io/docs/collector/quick-start/).
5858
59-
#### 2. Assign the endpoint value to your destination address
59+
### 2. Assign the endpoint value to your destination address
6060
61-
```
61+
```sh
6262
# Using environment variable
6363
ENV['OTEL_EXPORTER_OTLP_METRICS_ENDPOINT'] = 'http://host.docker.internal:4318/v1/metrics'
6464

6565
# Or using export command
6666
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://host.docker.internal:4318/v1/metrics
6767
```
6868

69-
#### 3. Run the script to send metric data to OTLP collector
69+
### 3. Run the script to send metric data to OTLP collector
7070

7171
```sh
7272
ruby metrics_collect_otlp.rb

0 commit comments

Comments
 (0)