Skip to content

Add lint script for bad case on "Datadog"#98

Merged
ErikBoesen merged 3 commits intomainfrom
lint-for-miscased-datadog
Sep 25, 2022
Merged

Add lint script for bad case on "Datadog"#98
ErikBoesen merged 3 commits intomainfrom
lint-for-miscased-datadog

Conversation

@Mr0grog
Copy link
Copy Markdown
Collaborator

@Mr0grog Mr0grog commented Sep 24, 2022

In #59, @dbenamy fixed a number of places where the text "DataDog" (incorrect) was used instead of "Datadog" (correct). People have since added more incorrect usages (many from me!), so this adds a quick script to log an error during linting to prevent re-introducing the problem.

It outputs something like (live example):

The correct spelling of "Datadog" does not capitalize the second "D".
Please fix these lines ("DataDogReporter" is allowed):

./index.js:10://     - apiKey: DataDog API key
./index.js:11://     - appKey: DataDog APP key
./lib/loggers.js:15:// This talks to the DataDog HTTP API to log a bunch of metrics.
./lib/loggers.js:19:// flushes them to DataDog.
./lib/loggers.js:21:// Look here if you want to learn more about the DataDog API:
./lib/loggers.js:27://     - apiKey: DataDog API key
./lib/loggers.js:28://     - appKey: DataDog APP key
./lib/loggers.js:94:        debug('Flushing %d metrics to DataDog', series.length);
./lib/metrics.js:206:// Similar to a histogram, but sends every point to DataDog and does the
./package.json:4:  "description": "Buffered metrics reporting via the DataDog HTTP API",
./README.md:132:        1. `reporters.DataDogReporter` sends metrics to DataDog’s API, and is
./README.md:220:server-side on DataDog’s systems. This is much higher-overhead than histograms,
./README.md:222:DataDog website instead of in the options for this package.
./README.md:278:        Distributions are similar to histograms (they create several metrics for count, average, percentiles, etc.), but they are calculated server-side on DataDog’s systems. For more details and guidance on when to use them, see:
./README.md:280:        * DataDog’s documentation at https://docs.datadoghq.com/metrics/distributions/
./README.md:358:    * Correct “DataDog” to “Datadog” throughout the documentation. It turns out there’s not supposed to be a captial D in the middle. (Thanks to @dbenamy.)

16 errors.

(Although hopefully on future PRs it will be shorter!)

Edit: fixed bad paste in example above.

In #59, @dbenamy fixed a number of places where the text "DataDog" (incorrect) was used instead of "Datadog" (correct). People have since added more incorrect usages (many from me!), so this adds a quick script to log an error during linting to prevent re-introducing the problem.
Copy link
Copy Markdown
Collaborator

@ErikBoesen ErikBoesen left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@ErikBoesen ErikBoesen merged commit 412852f into main Sep 25, 2022
@Mr0grog Mr0grog deleted the lint-for-miscased-datadog branch September 25, 2022 20:57
Mr0grog added a commit that referenced this pull request Sep 26, 2022
As a followup to #98, rename `DataDogReporter` to `DatadogReporter` (no capital "D" in the middle). I didn't add a deprecation warning here because we haven't yet had a release that exposes this class publicly, so nobody could have been using it before.
Mr0grog added a commit that referenced this pull request Sep 26, 2022
As a followup to #98, rename `DataDogReporter` to `DatadogReporter` (no capital "D" in the middle). I didn't add a deprecation warning here because we haven't yet had a release that exposes this class publicly, so nobody could have been using it before.
Mr0grog added a commit that referenced this pull request Feb 9, 2023
As a followup to #98, rename `DataDogReporter` to `DatadogReporter` (no capital "D" in the middle). I didn't add a deprecation warning here because we haven't yet had a release that exposes this class publicly, so nobody could have been using it before.
Mr0grog added a commit that referenced this pull request Feb 21, 2023
…100)

The `apiHost` property here is the same as what Datadog’s docs refer to `site`, so we’ve renamed it to match. We’ve also lower-cased the second "d" in `DatadogReporter`, since the previous spelling was wrong (see #59 and #98 for more about that).

Both of the old names still work, but using them prints deprecation warnings to let users know they should update their code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants