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

feat: immutable options in random.alpha methods #790

Merged
merged 7 commits into from
Apr 10, 2022

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Apr 6, 2022

Similar to other methods I changed random.alpha() and random.alphaNumeric() to don't alter their options.

Hints for reviewers:

  • I moved the default values to the method signature, to improve the api doc generation.
  • I also removed the array length check, as the called method does nothing, if the array is empty, and does so almost NO-OP.
    I can re-add the check, if you insist.

@ST-DDT ST-DDT added the p: 1-normal Nothing urgent label Apr 6, 2022
@ST-DDT ST-DDT added this to the v6.2 - New small features milestone Apr 6, 2022
@ST-DDT ST-DDT requested review from a team April 6, 2022 12:19
@ST-DDT ST-DDT self-assigned this Apr 6, 2022
@Shinigami92 Shinigami92 added the c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs label Apr 6, 2022
@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #790 (6d84908) into main (612fc38) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 6d84908 differs from pull request most recent head d548757. Consider uploading reports for the commit d548757 to get more accurate results

@@            Coverage Diff             @@
##             main     #790      +/-   ##
==========================================
- Coverage   99.35%   99.35%   -0.01%     
==========================================
  Files        1921     1921              
  Lines      179109   179074      -35     
  Branches      897      902       +5     
==========================================
- Hits       177961   177922      -39     
- Misses       1092     1096       +4     
  Partials       56       56              
Impacted Files Coverage Δ
src/random.ts 99.45% <100.00%> (-0.02%) ⬇️
src/utils/unique.ts 95.23% <0.00%> (-3.39%) ⬇️
src/unique.ts 100.00% <0.00%> (ø)

src/random.ts Outdated Show resolved Hide resolved
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.

Previously there was no failing test, please add one to test that the options are not mutated

@ST-DDT ST-DDT requested review from a team and Shinigami92 April 8, 2022 16:22
Shinigami92
Shinigami92 previously approved these changes Apr 8, 2022
@Shinigami92 Shinigami92 requested a review from a team April 8, 2022 16:33
@Shinigami92 Shinigami92 added the s: accepted Accepted feature / Confirmed bug label Apr 8, 2022
@ST-DDT ST-DDT requested a review from Shinigami92 April 9, 2022 01:33
@Shinigami92 Shinigami92 enabled auto-merge (squash) April 10, 2022 10:13
@Shinigami92 Shinigami92 merged commit dd11846 into main Apr 10, 2022
@ST-DDT ST-DDT deleted the feature/random/alpha-immutable-options branch April 26, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants