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

Add rule to detect duplicated entry in enum #1485

Merged

Conversation

Amachua
Copy link
Contributor

@Amachua Amachua commented Jan 26, 2021

Fixes #1478 .

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

@Amachua
Copy link
Contributor Author

Amachua commented Jan 27, 2021

@P0lip To make the repository properly worked on my computer, I've followed the instruction on your great documentation CONTRIBUTING but I've faced an issue that I resolved updating the file karma.conf.ts in the following manner:

-   browsers: ['ChromeHeadless'],
+   browsers: ['ChromeHeadlessNoSandbox'],
+
+   customLaunchers: {
+     ChromeHeadlessNoSandbox: {
+       base: 'ChromeHeadless',
+       flags: ['--no-sandbox']
+     }
+   },
`` 
Would you like me to also push this update?

@Amachua Amachua force-pushed the vidalqu/rules/check-duplicated-enum branch 3 times, most recently from 852092b to 3c8921f Compare January 27, 2021 20:18
philsturgeon
philsturgeon previously approved these changes Jan 28, 2021
@philsturgeon
Copy link
Contributor

Amazing work, thank you!

@Amachua Amachua force-pushed the vidalqu/rules/check-duplicated-enum branch from 7a82f16 to 99a1576 Compare January 29, 2021 08:53
@@ -397,6 +397,44 @@ TheBadModel:
- 8
```

### duplicated-entry-in-enum
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@philsturgeon While reviewing the file I've sent, I saw that I didn't sent the right sample on this file --> Updated with good samples :)

@Amachua Amachua requested a review from philsturgeon February 2, 2021 15:19
@@ -0,0 +1,33 @@
====test====
Identify enum values that does not respect the specified type
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Identify enum values that does not respect the specified type
Identify non-unique enum values

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, oops. Missed it. Going to keep that in mind and will include your suggestion in some other PR.

@philsturgeon
Copy link
Contributor

If that config change helps then please do.

@P0lip
Copy link
Contributor

P0lip commented Feb 3, 2021

@Amachua what was the error you had? Are you on Linux?

@P0lip P0lip merged commit 0a8e0a6 into stoplightio:develop Feb 3, 2021
@P0lip
Copy link
Contributor

P0lip commented Feb 3, 2021

I'll merge the PR in the meantime. LMK what that error was exactly about, so that we can evaluate the options.

@m-mohr
Copy link
Contributor

m-mohr commented Apr 7, 2021

This rule is too simple and should be fixed, see #1571

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.

Report duplicated values in enum
4 participants