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

infra(unicorn): numeric-separators-style #2815

Draft
wants to merge 9 commits into
base: next
Choose a base branch
from

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Apr 13, 2024

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: infra Changes to our infrastructure or project setup labels Apr 13, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Apr 13, 2024
@ST-DDT ST-DDT requested review from a team April 13, 2024 18:27
@ST-DDT ST-DDT self-assigned this Apr 13, 2024
Copy link

netlify bot commented Apr 13, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit 37e1d1c
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/664f75af3d0bd30008a56e88
😎 Deploy Preview https://deploy-preview-2815.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ST-DDT
Copy link
Member Author

ST-DDT commented Apr 13, 2024

Not sure about this one. Sometimes it looks useful, at other times the numbers aren't actual numbers...

Copy link

codecov bot commented Apr 13, 2024

Codecov Report

Attention: Patch coverage is 95.50562% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 99.95%. Comparing base (b97984c) to head (37e1d1c).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2815      +/-   ##
==========================================
- Coverage   99.95%   99.95%   -0.01%     
==========================================
  Files        2977     2977              
  Lines      215421   215421              
  Branches      948      947       -1     
==========================================
- Hits       215327   215326       -1     
- Misses         94       95       +1     
Files Coverage Δ
src/modules/color/index.ts 100.00% <100.00%> (ø)
src/modules/commerce/index.ts 98.57% <100.00%> (ø)
src/modules/image/index.ts 100.00% <100.00%> (ø)
src/modules/internet/index.ts 100.00% <100.00%> (ø)
src/modules/location/index.ts 100.00% <100.00%> (ø)
src/modules/number/index.ts 100.00% <100.00%> (ø)
src/modules/internet/user-agent.ts 91.47% <0.00%> (-0.30%) ⬇️
src/internal/mersenne.ts 97.58% <85.00%> (ø)

Shinigami92
Shinigami92 previously approved these changes Apr 26, 2024
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

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

Sill thinking that it looks weird for digits <= 5 🤷

Copy link
Contributor

@matthewmayer matthewmayer left a comment

Choose a reason for hiding this comment

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

I'm not convinced about the need for this rule. I think we could leave it up to authors to use separators when appropriate.

@@ -171,7 +171,7 @@ ${examples}`;

// This only checks whether the whole method is deprecated or not
// It does not check whether the method is deprecated for a specific set of arguments
it('verify @deprecated tag', { timeout: 30000 }, async () => {
it('verify @deprecated tag', { timeout: 30_000 }, async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Some cases like this are an improvement

['IL', 60001, 62999],
['GA', 30001, 31999],
['WA', 98001, 99403],
['IL', 60_001, 62_999],
Copy link
Contributor

Choose a reason for hiding this comment

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

But some like this are worse

Copy link
Member Author

@ST-DDT ST-DDT Apr 26, 2024

Choose a reason for hiding this comment

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

Curious: Could you please give some insights why you consider this worse than the case above and the original?
Is it because the resulting value doesn't have it/isn't really a number?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not Beverly Hills 90_210

@ST-DDT ST-DDT requested review from a team April 26, 2024 07:49
@ST-DDT ST-DDT added the s: needs decision Needs team/maintainer decision label May 18, 2024
@xDivisionByZerox
Copy link
Member

I've evaluated the proposed rule again and it has become apparent for me that its implementation could generally enhance the uniformity of "magic number" definitions within a codebase. However, our repository's unique context, where numeric values often carry specific meanings, may be compromised by the adoption of numeric separator syntax. This concern was previously expressed by @matthewmayer (see here) as well.

While it is possible to configure the rule to enforce separators only where they currently exist, thereby standardizing their usage (e.g., in groups of three), this approach contradicts the rationale for introducing the rule in the first place.

Given these considerations, I propose that we opt not to include this rule in our ruleset.

@ST-DDT
Copy link
Member Author

ST-DDT commented May 23, 2024

Team Decision

  • We will disable this rule permanently

@ST-DDT ST-DDT removed the s: needs decision Needs team/maintainer decision label May 23, 2024
@ST-DDT ST-DDT marked this pull request as draft May 23, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants