diff --git a/README.md b/README.md
index 6b40f1359b..1636728535 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@ like any other class.
> NOTE: Due to performance of the hosted JavaScript engine and marshaling costs,
__jsii__ modules are likely to be used for development and build tools, as
-oppose to performance-sensitive runtime behavior.
+opposed to performance-sensitive runtime behavior.
From Java:
diff --git a/packages/jsii-calc-lib/lib/index.ts b/packages/jsii-calc-lib/lib/index.ts
index c1e1a616aa..295ab1ef7c 100644
--- a/packages/jsii-calc-lib/lib/index.ts
+++ b/packages/jsii-calc-lib/lib/index.ts
@@ -95,8 +95,8 @@ export interface StructWithOnlyOptionals {
* See awslabs/jsii#138
*/
export enum EnumFromScopedModule {
- Value1,
- Value2
+ VALUE1,
+ VALUE2
}
/**
diff --git a/packages/jsii-calc-lib/test/assembly.jsii b/packages/jsii-calc-lib/test/assembly.jsii
index 64ee0bcf09..99adf00bbe 100644
--- a/packages/jsii-calc-lib/test/assembly.jsii
+++ b/packages/jsii-calc-lib/test/assembly.jsii
@@ -136,13 +136,13 @@
"docs": {
"stability": "deprecated"
},
- "name": "Value1"
+ "name": "VALUE1"
},
{
"docs": {
"stability": "deprecated"
},
- "name": "Value2"
+ "name": "VALUE2"
}
],
"name": "EnumFromScopedModule"
@@ -540,5 +540,5 @@
}
},
"version": "0.11.3",
- "fingerprint": "jAkwT5aChzSZi3hTeylIFDPL1J8qUy++0B75C5vIA6Y="
+ "fingerprint": "iggTfEXzBxodU2TEDzkmrmsuEakOvA/UXmOA/8nQboU="
}
diff --git a/packages/jsii-calc/lib/calculator.ts b/packages/jsii-calc/lib/calculator.ts
index 00730f1ac5..0e82f366c4 100644
--- a/packages/jsii-calc/lib/calculator.ts
+++ b/packages/jsii-calc/lib/calculator.ts
@@ -133,7 +133,7 @@ export namespace composition {
/**
* The .toString() style.
*/
- public stringStyle = CompositeOperation.CompositionStringStyle.Normal
+ public stringStyle = CompositeOperation.CompositionStringStyle.NORMAL
/**
* A set of prefixes to include in a decorated .toString().
@@ -157,9 +157,9 @@ export namespace composition {
toString() {
switch (this.stringStyle) {
- case CompositeOperation.CompositionStringStyle.Normal:
+ case CompositeOperation.CompositionStringStyle.NORMAL:
return this.expression.toString();
- case CompositeOperation.CompositionStringStyle.Decorated:
+ case CompositeOperation.CompositionStringStyle.DECORATED:
return this.decorationPrefixes.join('') + this.expression.toString() + this.decorationPostfixes.join('');
default:
throw new Error(`Unknown string style: ${this.stringStyle}`);
@@ -173,10 +173,10 @@ export namespace composition {
*/
export enum CompositionStringStyle {
/** Normal string expression */
- Normal,
+ NORMAL,
/** Decorated string expression */
- Decorated
+ DECORATED
}
}
}
diff --git a/packages/jsii-calc/lib/compliance.ts b/packages/jsii-calc/lib/compliance.ts
index a5194ccd75..cff955bd89 100644
--- a/packages/jsii-calc/lib/compliance.ts
+++ b/packages/jsii-calc/lib/compliance.ts
@@ -21,9 +21,9 @@ import base = require('@scope/jsii-calc-base');
const readFile = promisify(fs.readFile);
export enum AllTypesEnum {
- MyEnumValue,
- YourEnumValue = 100,
- ThisIsGreat
+ MY_ENUM_VALUE,
+ YOUR_ENUM_VALUE = 100,
+ THIS_IS_GREAT
}
export enum StringEnum {
@@ -169,7 +169,7 @@ export class AllTypes {
// enum
public optionalEnumValue?: StringEnum;
- private enumValue: AllTypesEnum = AllTypesEnum.ThisIsGreat;
+ private enumValue: AllTypesEnum = AllTypesEnum.THIS_IS_GREAT;
get enumProperty() {
return this.enumValue;
@@ -178,9 +178,9 @@ export class AllTypes {
set enumProperty(value: AllTypesEnum) {
this.enumValue = value;
switch (value) {
- case AllTypesEnum.MyEnumValue:
- case AllTypesEnum.YourEnumValue:
- case AllTypesEnum.ThisIsGreat:
+ case AllTypesEnum.MY_ENUM_VALUE:
+ case AllTypesEnum.YOUR_ENUM_VALUE:
+ case AllTypesEnum.THIS_IS_GREAT:
return;
default:
throw new Error('Invalid enum: ' + value);
@@ -1008,7 +1008,7 @@ export interface ImplictBaseOfBase extends base.BaseProps {
* See awslabs/jsii#138
*/
export class ReferenceEnumFromScopedPackage {
- public foo?: EnumFromScopedModule = EnumFromScopedModule.Value2;
+ public foo?: EnumFromScopedModule = EnumFromScopedModule.VALUE2;
public loadFoo(): EnumFromScopedModule | undefined {
return this.foo;
@@ -1594,7 +1594,7 @@ export abstract class PartiallyInitializedThisConsumer {
export class ConstructorPassesThisOut {
constructor(consumer: PartiallyInitializedThisConsumer) {
- const result = consumer.consumePartiallyInitializedThis(this, new Date(0), AllTypesEnum.ThisIsGreat);
+ const result = consumer.consumePartiallyInitializedThis(this, new Date(0), AllTypesEnum.THIS_IS_GREAT);
if (result !== 'OK') {
throw new Error(`Expected OK but received ${result}`);
}
@@ -1702,13 +1702,13 @@ export class SingletonString {
private constructor() { }
public isSingletonString(value: string): boolean {
- return value === SingletonStringEnum.SingletonString;
+ return value === SingletonStringEnum.SINGLETON_STRING;
}
}
/** A singleton string */
export enum SingletonStringEnum {
/** 1337 */
- SingletonString = '3L1T3!'
+ SINGLETON_STRING = '3L1T3!'
}
/**
* Verifies that singleton enums are handled correctly
@@ -1718,11 +1718,11 @@ export enum SingletonStringEnum {
export class SingletonInt {
private constructor() { }
public isSingletonInt(value: number): boolean {
- return value === SingletonIntEnum.SingletonInt;
+ return value === SingletonIntEnum.SINGLETON_INT;
}
}
/** A singleton integer. */
export enum SingletonIntEnum {
/** Elite! */
- SingletonInt = 1337
+ SINGLETON_INT = 1337
}
diff --git a/packages/jsii-calc/lib/stability.ts b/packages/jsii-calc/lib/stability.ts
index 7fb132b0df..f9b75a19f1 100644
--- a/packages/jsii-calc/lib/stability.ts
+++ b/packages/jsii-calc/lib/stability.ts
@@ -30,9 +30,9 @@ export class ExperimentalClass {
/** @experimental */
export enum ExperimentalEnum {
/** @experimental */
- OptionA,
+ OPTION_A,
/** @experimental */
- OptionB
+ OPTION_B
}
/** @stable */
@@ -64,9 +64,9 @@ export class StableClass {
/** @stable */
export enum StableEnum {
/** @stable */
- OptionA,
+ OPTION_A,
/** @stable */
- OptionB
+ OPTION_B
}
/** @deprecated it just wraps a string */
@@ -98,7 +98,7 @@ export class DeprecatedClass {
/** @deprecated your deprecated selection of bad options */
export enum DeprecatedEnum {
/** @deprecated option A is not great */
- OptionA,
+ OPTION_A,
/** @deprecated option B is kinda bad, too */
- OptionB
+ OPTION_B
}
diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii
index f13248045e..d5ede687e7 100644
--- a/packages/jsii-calc/test/assembly.jsii
+++ b/packages/jsii-calc/test/assembly.jsii
@@ -892,19 +892,19 @@
"docs": {
"stability": "experimental"
},
- "name": "MyEnumValue"
+ "name": "MY_ENUM_VALUE"
},
{
"docs": {
"stability": "experimental"
},
- "name": "YourEnumValue"
+ "name": "YOUR_ENUM_VALUE"
},
{
"docs": {
"stability": "experimental"
},
- "name": "ThisIsGreat"
+ "name": "THIS_IS_GREAT"
}
],
"name": "AllTypesEnum"
@@ -2262,14 +2262,14 @@
"deprecated": "option A is not great",
"stability": "deprecated"
},
- "name": "OptionA"
+ "name": "OPTION_A"
},
{
"docs": {
"deprecated": "option B is kinda bad, too",
"stability": "deprecated"
},
- "name": "OptionB"
+ "name": "OPTION_B"
}
],
"name": "DeprecatedEnum"
@@ -2972,13 +2972,13 @@
"docs": {
"stability": "experimental"
},
- "name": "OptionA"
+ "name": "OPTION_A"
},
{
"docs": {
"stability": "experimental"
},
- "name": "OptionB"
+ "name": "OPTION_B"
}
],
"name": "ExperimentalEnum"
@@ -7179,7 +7179,7 @@
"stability": "experimental",
"summary": "Elite!"
},
- "name": "SingletonInt"
+ "name": "SINGLETON_INT"
}
],
"name": "SingletonIntEnum"
@@ -7242,7 +7242,7 @@
"stability": "experimental",
"summary": "1337."
},
- "name": "SingletonString"
+ "name": "SINGLETON_STRING"
}
],
"name": "SingletonStringEnum"
@@ -7338,13 +7338,13 @@
"docs": {
"stability": "stable"
},
- "name": "OptionA"
+ "name": "OPTION_A"
},
{
"docs": {
"stability": "stable"
},
- "name": "OptionB"
+ "name": "OPTION_B"
}
],
"name": "StableEnum"
@@ -8759,14 +8759,14 @@
"stability": "experimental",
"summary": "Normal string expression."
},
- "name": "Normal"
+ "name": "NORMAL"
},
{
"docs": {
"stability": "experimental",
"summary": "Decorated string expression."
},
- "name": "Decorated"
+ "name": "DECORATED"
}
],
"name": "CompositionStringStyle",
@@ -8774,5 +8774,5 @@
}
},
"version": "0.11.3",
- "fingerprint": "PRTiHZmA0R0OqG2aleNqw5twteIgxeOUgjhzIkQMaxg="
+ "fingerprint": "ap5kT9z2b1y6ofObpCic6pDWcRTWCr0ivtq83hsi6ds="
}
diff --git a/packages/jsii-calc/test/test.calc.ts b/packages/jsii-calc/test/test.calc.ts
index a2bc89a587..c1854818b3 100644
--- a/packages/jsii-calc/test/test.calc.ts
+++ b/packages/jsii-calc/test/test.calc.ts
@@ -30,7 +30,7 @@ calc.neg(); assert.equal(-3200000, calc.value);
calc.curr = new Multiply(new calcLib.Number(2), calc.curr);
assert.equal(-6400000, calc.value);
-calc.stringStyle = composition.CompositeOperation.CompositionStringStyle.Decorated;
+calc.stringStyle = composition.CompositeOperation.CompositionStringStyle.DECORATED;
assert.equal(calc.toString(),
'<<[[{{(2 * -(((((1 * ((0 + 10) * 2)) * ((0 + 10) * 2)) * ((0 + 10) * 2)) * ((0 + 10) * 2)) * ((0 + 10) * 2)))}}]]>>');
diff --git a/packages/jsii-diff/test/test.enums.ts b/packages/jsii-diff/test/test.enums.ts
index 664ae2b4d7..fd9d1e5dcb 100644
--- a/packages/jsii-diff/test/test.enums.ts
+++ b/packages/jsii-diff/test/test.enums.ts
@@ -9,14 +9,14 @@ export = {
async 'okay to add a member to an enum'(test: Test) {
await expectNoError(test, `
export enum Foo {
- Bar,
- Baz,
+ BAR,
+ BAZ,
}
`, `
export enum Foo {
- Bar,
- Baz,
- Quux
+ BAR,
+ BAZ,
+ QUUX
}
`);
test.done();
@@ -26,17 +26,17 @@ export = {
async 'not okay to remove a member from an enum'(test: Test) {
await expectError(test,
- /member Quux has been removed/,
+ /member QUUX has been removed/,
`
export enum Foo {
- Bar,
- Baz,
- Quux
+ BAR,
+ BAZ,
+ QUUX
}
`, `
export enum Foo {
- Bar,
- Baz
+ BAR,
+ BAZ
}
`);
test.done();
diff --git a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs
index 665ef86872..2e4b1e3b5b 100644
--- a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs
+++ b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs
@@ -260,9 +260,9 @@ public void GetAndSetEnumValues()
calc.Add(9);
calc.Pow(3);
- Assert.Equal(CompositionStringStyle.Normal, calc.StringStyle);
- calc.StringStyle = CompositionStringStyle.Decorated;
- Assert.Equal(CompositionStringStyle.Decorated, calc.StringStyle);
+ Assert.Equal(CompositionStringStyle.NORMAL, calc.StringStyle);
+ calc.StringStyle = CompositionStringStyle.DECORATED;
+ Assert.Equal(CompositionStringStyle.DECORATED, calc.StringStyle);
Assert.Equal("<<[[{{(((1 * (0 + 9)) * (0 + 9)) * (0 + 9))}}]]>>", calc.ToString());
}
@@ -270,11 +270,11 @@ public void GetAndSetEnumValues()
public void UseEnumFromScopedModule()
{
ReferenceEnumFromScopedPackage obj = new ReferenceEnumFromScopedPackage();
- Assert.Equal(EnumFromScopedModule.Value2, obj.Foo);
- obj.Foo = EnumFromScopedModule.Value1;
- Assert.Equal(EnumFromScopedModule.Value1, obj.LoadFoo());
- obj.SaveFoo(EnumFromScopedModule.Value2);
- Assert.Equal(EnumFromScopedModule.Value2, obj.Foo);
+ Assert.Equal(EnumFromScopedModule.VALUE2, obj.Foo);
+ obj.Foo = EnumFromScopedModule.VALUE1;
+ Assert.Equal(EnumFromScopedModule.VALUE1, obj.LoadFoo());
+ obj.SaveFoo(EnumFromScopedModule.VALUE2);
+ Assert.Equal(EnumFromScopedModule.VALUE2, obj.Foo);
}
[Fact(DisplayName = Prefix + nameof(UndefinedAndNull))]
@@ -929,7 +929,7 @@ public override String ConsumePartiallyInitializedThis(ConstructorPassesThisOut
{
Assert.NotNull(obj);
Assert.Equal(new DateTime(0), dt);
- Assert.Equal(AllTypesEnum.ThisIsGreat, ev);
+ Assert.Equal(AllTypesEnum.THIS_IS_GREAT, ev);
return "OK";
}
diff --git a/packages/jsii-java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java b/packages/jsii-java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java
index d98dbd1ed2..afd17aba4e 100644
--- a/packages/jsii-java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java
+++ b/packages/jsii-java-runtime-test/project/src/test/java/software/amazon/jsii/testing/ComplianceTest.java
@@ -259,20 +259,20 @@ public void getAndSetEnumValues() {
Calculator calc = new Calculator();
calc.add(9);
calc.pow(3);
- assertEquals(CompositeOperation.CompositionStringStyle.Normal, calc.getStringStyle());
- calc.setStringStyle(CompositeOperation.CompositionStringStyle.Decorated);
- assertEquals(CompositeOperation.CompositionStringStyle.Decorated, calc.getStringStyle());
+ assertEquals(CompositeOperation.CompositionStringStyle.NORMAL, calc.getStringStyle());
+ calc.setStringStyle(CompositeOperation.CompositionStringStyle.DECORATED);
+ assertEquals(CompositeOperation.CompositionStringStyle.DECORATED, calc.getStringStyle());
assertEquals("<<[[{{(((1 * (0 + 9)) * (0 + 9)) * (0 + 9))}}]]>>", calc.toString());
}
@Test
public void useEnumFromScopedModule() {
ReferenceEnumFromScopedPackage obj = new ReferenceEnumFromScopedPackage();
- assertEquals(EnumFromScopedModule.Value2, obj.getFoo());
- obj.setFoo(EnumFromScopedModule.Value1);
- assertEquals(EnumFromScopedModule.Value1, obj.loadFoo());
- obj.saveFoo(EnumFromScopedModule.Value2);
- assertEquals(EnumFromScopedModule.Value2, obj.getFoo());
+ assertEquals(EnumFromScopedModule.VALUE2, obj.getFoo());
+ obj.setFoo(EnumFromScopedModule.VALUE1);
+ assertEquals(EnumFromScopedModule.VALUE1, obj.loadFoo());
+ obj.saveFoo(EnumFromScopedModule.VALUE2);
+ assertEquals(EnumFromScopedModule.VALUE2, obj.getFoo());
}
@Test
@@ -1044,7 +1044,7 @@ public String consumePartiallyInitializedThis(final ConstructorPassesThisOut obj
final AllTypesEnum en) {
assertNotNull(obj);
assertEquals(Instant.EPOCH, dt);
- assertEquals(AllTypesEnum.ThisIsGreat, en);
+ assertEquals(AllTypesEnum.THIS_IS_GREAT, en);
return "OK";
}
diff --git a/packages/jsii-kernel/test/test.kernel.ts b/packages/jsii-kernel/test/test.kernel.ts
index cac631a623..a344676082 100644
--- a/packages/jsii-kernel/test/test.kernel.ts
+++ b/packages/jsii-kernel/test/test.kernel.ts
@@ -176,28 +176,28 @@ defineTest('in/out date values', async (test, sandbox) => {
defineTest('in/out enum values', async (test, sandbox) => {
const alltypes = sandbox.create({ fqn: 'jsii-calc.AllTypes' });
- sandbox.set({ objref: alltypes, property: 'enumProperty', value: { [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/MyEnumValue' } });
+ sandbox.set({ objref: alltypes, property: 'enumProperty', value: { [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/MY_ENUM_VALUE' } });
test.equal(sandbox.get({ objref: alltypes, property: 'enumPropertyValue' }).value, 0);
- sandbox.set({ objref: alltypes, property: 'enumProperty', value: { [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/YourEnumValue' } });
+ sandbox.set({ objref: alltypes, property: 'enumProperty', value: { [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/YOUR_ENUM_VALUE' } });
test.equal(sandbox.get({ objref: alltypes, property: 'enumPropertyValue' }).value, 100);
- sandbox.set({ objref: alltypes, property: 'enumProperty', value: { [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/ThisIsGreat' } });
+ sandbox.set({ objref: alltypes, property: 'enumProperty', value: { [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/THIS_IS_GREAT' } });
test.equal(sandbox.get({ objref: alltypes, property: 'enumPropertyValue' }).value, 101);
- test.deepEqual(sandbox.get({ objref: alltypes, property: 'enumProperty' }).value, { '$jsii.enum': 'jsii-calc.AllTypesEnum/ThisIsGreat' });
+ test.deepEqual(sandbox.get({ objref: alltypes, property: 'enumProperty' }).value, { '$jsii.enum': 'jsii-calc.AllTypesEnum/THIS_IS_GREAT' });
});
defineTest('enum values from @scoped packages awslabs/jsii#138', async (test, sandbox) => {
const objref = sandbox.create({ fqn: 'jsii-calc.ReferenceEnumFromScopedPackage' });
const value = sandbox.get({ objref, property: 'foo' });
- test.deepEqual(value, { value: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/Value2' } });
+ test.deepEqual(value, { value: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/VALUE2' } });
- sandbox.set({ objref, property: 'foo', value: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/Value1' }});
+ sandbox.set({ objref, property: 'foo', value: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/VALUE1' }});
const ret = sandbox.invoke({ objref, method: 'loadFoo' });
- test.deepEqual(ret, { result: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/Value1' } });
+ test.deepEqual(ret, { result: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/VALUE1' } });
- sandbox.invoke({ objref, method: 'saveFoo', args: [ { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/Value2' } ] });
+ sandbox.invoke({ objref, method: 'saveFoo', args: [ { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/VALUE2' } ] });
const value2 = sandbox.get({ objref, property: 'foo' });
- test.deepEqual(value2, { value: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/Value2' } });
+ test.deepEqual(value2, { value: { '$jsii.enum': '@scope/jsii-calc-lib.EnumFromScopedModule/VALUE2' } });
});
defineTest('fails for invalid enum member name', async (test, sandbox) => {
@@ -1125,7 +1125,7 @@ defineTest('Object ID does not get re-allocated when the constructor passes "thi
}, {
[api.TOKEN_DATE]: '1970-01-01T00:00:00.000Z'
}, {
- [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/ThisIsGreat'
+ [api.TOKEN_ENUM]: 'jsii-calc.AllTypesEnum/THIS_IS_GREAT'
}]);
return 'OK';
});
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii
index 64ee0bcf09..99adf00bbe 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii
+++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii
@@ -136,13 +136,13 @@
"docs": {
"stability": "deprecated"
},
- "name": "Value1"
+ "name": "VALUE1"
},
{
"docs": {
"stability": "deprecated"
},
- "name": "Value2"
+ "name": "VALUE2"
}
],
"name": "EnumFromScopedModule"
@@ -540,5 +540,5 @@
}
},
"version": "0.11.3",
- "fingerprint": "jAkwT5aChzSZi3hTeylIFDPL1J8qUy++0B75C5vIA6Y="
+ "fingerprint": "iggTfEXzBxodU2TEDzkmrmsuEakOvA/UXmOA/8nQboU="
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs
index ba087e2af0..7a826db1f3 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs
@@ -9,12 +9,12 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace
public enum EnumFromScopedModule
{
/// stability: Deprecated
- [JsiiEnumMember(name: "Value1")]
+ [JsiiEnumMember(name: "VALUE1")]
[System.Obsolete()]
- Value1,
+ VALUE1,
/// stability: Deprecated
- [JsiiEnumMember(name: "Value2")]
+ [JsiiEnumMember(name: "VALUE2")]
[System.Obsolete()]
- Value2
+ VALUE2
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/EnumFromScopedModule.java b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/EnumFromScopedModule.java
index 47bbcb0913..26f684aa91 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/EnumFromScopedModule.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/EnumFromScopedModule.java
@@ -12,10 +12,10 @@ public enum EnumFromScopedModule {
*/
@Deprecated
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
- Value1,
+ VALUE1,
/**
*/
@Deprecated
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
- Value2,
+ VALUE2,
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py
index 79611a4563..931cf1dcdd 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py
+++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py
@@ -18,12 +18,12 @@ class EnumFromScopedModule(enum.Enum):
Stability:
deprecated
"""
- Value1 = "Value1"
+ VALUE1 = "VALUE1"
"""
Stability:
deprecated
"""
- Value2 = "Value2"
+ VALUE2 = "VALUE2"
"""
Stability:
deprecated
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst b/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst
index 288683148a..f2b8c752dd 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst
+++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/sphinx/_scope_jsii-calc-lib.rst
@@ -154,9 +154,9 @@ EnumFromScopedModule (enum)
- .. py:data:: Value1
+ .. py:data:: VALUE1
- .. py:data:: Value2
+ .. py:data:: VALUE2
IDoublable (interface)
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii
index f13248045e..d5ede687e7 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii
@@ -892,19 +892,19 @@
"docs": {
"stability": "experimental"
},
- "name": "MyEnumValue"
+ "name": "MY_ENUM_VALUE"
},
{
"docs": {
"stability": "experimental"
},
- "name": "YourEnumValue"
+ "name": "YOUR_ENUM_VALUE"
},
{
"docs": {
"stability": "experimental"
},
- "name": "ThisIsGreat"
+ "name": "THIS_IS_GREAT"
}
],
"name": "AllTypesEnum"
@@ -2262,14 +2262,14 @@
"deprecated": "option A is not great",
"stability": "deprecated"
},
- "name": "OptionA"
+ "name": "OPTION_A"
},
{
"docs": {
"deprecated": "option B is kinda bad, too",
"stability": "deprecated"
},
- "name": "OptionB"
+ "name": "OPTION_B"
}
],
"name": "DeprecatedEnum"
@@ -2972,13 +2972,13 @@
"docs": {
"stability": "experimental"
},
- "name": "OptionA"
+ "name": "OPTION_A"
},
{
"docs": {
"stability": "experimental"
},
- "name": "OptionB"
+ "name": "OPTION_B"
}
],
"name": "ExperimentalEnum"
@@ -7179,7 +7179,7 @@
"stability": "experimental",
"summary": "Elite!"
},
- "name": "SingletonInt"
+ "name": "SINGLETON_INT"
}
],
"name": "SingletonIntEnum"
@@ -7242,7 +7242,7 @@
"stability": "experimental",
"summary": "1337."
},
- "name": "SingletonString"
+ "name": "SINGLETON_STRING"
}
],
"name": "SingletonStringEnum"
@@ -7338,13 +7338,13 @@
"docs": {
"stability": "stable"
},
- "name": "OptionA"
+ "name": "OPTION_A"
},
{
"docs": {
"stability": "stable"
},
- "name": "OptionB"
+ "name": "OPTION_B"
}
],
"name": "StableEnum"
@@ -8759,14 +8759,14 @@
"stability": "experimental",
"summary": "Normal string expression."
},
- "name": "Normal"
+ "name": "NORMAL"
},
{
"docs": {
"stability": "experimental",
"summary": "Decorated string expression."
},
- "name": "Decorated"
+ "name": "DECORATED"
}
],
"name": "CompositionStringStyle",
@@ -8774,5 +8774,5 @@
}
},
"version": "0.11.3",
- "fingerprint": "PRTiHZmA0R0OqG2aleNqw5twteIgxeOUgjhzIkQMaxg="
+ "fingerprint": "ap5kT9z2b1y6ofObpCic6pDWcRTWCr0ivtq83hsi6ds="
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs
index 79542cb0b4..cb2743f148 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs
@@ -7,13 +7,13 @@ namespace Amazon.JSII.Tests.CalculatorNamespace
public enum AllTypesEnum
{
/// stability: Experimental
- [JsiiEnumMember(name: "MyEnumValue")]
- MyEnumValue,
+ [JsiiEnumMember(name: "MY_ENUM_VALUE")]
+ MY_ENUM_VALUE,
/// stability: Experimental
- [JsiiEnumMember(name: "YourEnumValue")]
- YourEnumValue,
+ [JsiiEnumMember(name: "YOUR_ENUM_VALUE")]
+ YOUR_ENUM_VALUE,
/// stability: Experimental
- [JsiiEnumMember(name: "ThisIsGreat")]
- ThisIsGreat
+ [JsiiEnumMember(name: "THIS_IS_GREAT")]
+ THIS_IS_GREAT
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DeprecatedEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DeprecatedEnum.cs
index f2a4472519..3aa8714d25 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DeprecatedEnum.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DeprecatedEnum.cs
@@ -8,12 +8,12 @@ namespace Amazon.JSII.Tests.CalculatorNamespace
public enum DeprecatedEnum
{
/// stability: Deprecated
- [JsiiEnumMember(name: "OptionA")]
+ [JsiiEnumMember(name: "OPTION_A")]
[System.Obsolete("option A is not great")]
- OptionA,
+ OPTION_A,
/// stability: Deprecated
- [JsiiEnumMember(name: "OptionB")]
+ [JsiiEnumMember(name: "OPTION_B")]
[System.Obsolete("option B is kinda bad, too")]
- OptionB
+ OPTION_B
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExperimentalEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExperimentalEnum.cs
index 7337ef57c4..9f81524b2b 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExperimentalEnum.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ExperimentalEnum.cs
@@ -7,10 +7,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace
public enum ExperimentalEnum
{
/// stability: Experimental
- [JsiiEnumMember(name: "OptionA")]
- OptionA,
+ [JsiiEnumMember(name: "OPTION_A")]
+ OPTION_A,
/// stability: Experimental
- [JsiiEnumMember(name: "OptionB")]
- OptionB
+ [JsiiEnumMember(name: "OPTION_B")]
+ OPTION_B
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonIntEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonIntEnum.cs
index ac0c53ce28..631314be96 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonIntEnum.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonIntEnum.cs
@@ -9,7 +9,7 @@ public enum SingletonIntEnum
{
/// Elite!
/// stability: Experimental
- [JsiiEnumMember(name: "SingletonInt")]
- SingletonInt
+ [JsiiEnumMember(name: "SINGLETON_INT")]
+ SINGLETON_INT
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonStringEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonStringEnum.cs
index 4d4556d68e..d538cbc616 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonStringEnum.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SingletonStringEnum.cs
@@ -9,7 +9,7 @@ public enum SingletonStringEnum
{
/// 1337.
/// stability: Experimental
- [JsiiEnumMember(name: "SingletonString")]
- SingletonString
+ [JsiiEnumMember(name: "SINGLETON_STRING")]
+ SINGLETON_STRING
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StableEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StableEnum.cs
index 3e84219846..2fa56c7550 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StableEnum.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StableEnum.cs
@@ -7,10 +7,10 @@ namespace Amazon.JSII.Tests.CalculatorNamespace
public enum StableEnum
{
/// stability: Stable
- [JsiiEnumMember(name: "OptionA")]
- OptionA,
+ [JsiiEnumMember(name: "OPTION_A")]
+ OPTION_A,
/// stability: Stable
- [JsiiEnumMember(name: "OptionB")]
- OptionB
+ [JsiiEnumMember(name: "OPTION_B")]
+ OPTION_B
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs
index db1a9bf7e1..19fbebaf6f 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs
@@ -9,11 +9,11 @@ public enum CompositionStringStyle
{
/// Normal string expression.
/// stability: Experimental
- [JsiiEnumMember(name: "Normal")]
- Normal,
+ [JsiiEnumMember(name: "NORMAL")]
+ NORMAL,
/// Decorated string expression.
/// stability: Experimental
- [JsiiEnumMember(name: "Decorated")]
- Decorated
+ [JsiiEnumMember(name: "DECORATED")]
+ DECORATED
}
}
\ No newline at end of file
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypesEnum.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypesEnum.java
index 330f74b6d4..5037016559 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypesEnum.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/AllTypesEnum.java
@@ -11,15 +11,15 @@ public enum AllTypesEnum {
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- MyEnumValue,
+ MY_ENUM_VALUE,
/**
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- YourEnumValue,
+ YOUR_ENUM_VALUE,
/**
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- ThisIsGreat,
+ THIS_IS_GREAT,
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DeprecatedEnum.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DeprecatedEnum.java
index 2200438388..35e8b9bb14 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DeprecatedEnum.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DeprecatedEnum.java
@@ -13,11 +13,11 @@ public enum DeprecatedEnum {
*/
@Deprecated
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
- OptionA,
+ OPTION_A,
/**
* @deprecated option B is kinda bad, too
*/
@Deprecated
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
- OptionB,
+ OPTION_B,
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ExperimentalEnum.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ExperimentalEnum.java
index 068e43779e..f4fdd8d755 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ExperimentalEnum.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ExperimentalEnum.java
@@ -11,10 +11,10 @@ public enum ExperimentalEnum {
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- OptionA,
+ OPTION_A,
/**
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- OptionB,
+ OPTION_B,
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonIntEnum.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonIntEnum.java
index 976868f731..7f7f834ce2 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonIntEnum.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonIntEnum.java
@@ -15,5 +15,5 @@ public enum SingletonIntEnum {
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- SingletonInt,
+ SINGLETON_INT,
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonStringEnum.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonStringEnum.java
index 7c2a5e84d2..d35515a569 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonStringEnum.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SingletonStringEnum.java
@@ -15,5 +15,5 @@ public enum SingletonStringEnum {
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- SingletonString,
+ SINGLETON_STRING,
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StableEnum.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StableEnum.java
index a150455ab7..7bc834ceba 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StableEnum.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StableEnum.java
@@ -9,9 +9,9 @@ public enum StableEnum {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
- OptionA,
+ OPTION_A,
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
- OptionB,
+ OPTION_B,
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/composition/CompositeOperation.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/composition/CompositeOperation.java
index a1a4c9e8dc..ac9d9ef296 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/composition/CompositeOperation.java
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/composition/CompositeOperation.java
@@ -122,14 +122,14 @@ public enum CompositionStringStyle {
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- Normal,
+ NORMAL,
/**
* Decorated string expression.
*
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
- Decorated,
+ DECORATED,
}
/**
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py
index f3a90c217c..993713dc17 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py
@@ -373,17 +373,17 @@ class AllTypesEnum(enum.Enum):
Stability:
experimental
"""
- MyEnumValue = "MyEnumValue"
+ MY_ENUM_VALUE = "MY_ENUM_VALUE"
"""
Stability:
experimental
"""
- YourEnumValue = "YourEnumValue"
+ YOUR_ENUM_VALUE = "YOUR_ENUM_VALUE"
"""
Stability:
experimental
"""
- ThisIsGreat = "ThisIsGreat"
+ THIS_IS_GREAT = "THIS_IS_GREAT"
"""
Stability:
experimental
@@ -929,7 +929,7 @@ class DeprecatedEnum(enum.Enum):
Stability:
deprecated
"""
- OptionA = "OptionA"
+ OPTION_A = "OPTION_A"
"""
Deprecated:
option A is not great
@@ -937,7 +937,7 @@ class DeprecatedEnum(enum.Enum):
Stability:
deprecated
"""
- OptionB = "OptionB"
+ OPTION_B = "OPTION_B"
"""
Deprecated:
option B is kinda bad, too
@@ -1287,12 +1287,12 @@ class ExperimentalEnum(enum.Enum):
Stability:
experimental
"""
- OptionA = "OptionA"
+ OPTION_A = "OPTION_A"
"""
Stability:
experimental
"""
- OptionB = "OptionB"
+ OPTION_B = "OPTION_B"
"""
Stability:
experimental
@@ -4745,7 +4745,7 @@ class SingletonIntEnum(enum.Enum):
Stability:
experimental
"""
- SingletonInt = "SingletonInt"
+ SINGLETON_INT = "SINGLETON_INT"
"""Elite!
Stability:
@@ -4779,7 +4779,7 @@ class SingletonStringEnum(enum.Enum):
Stability:
experimental
"""
- SingletonString = "SingletonString"
+ SINGLETON_STRING = "SINGLETON_STRING"
"""1337.
Stability:
@@ -4839,12 +4839,12 @@ class StableEnum(enum.Enum):
Stability:
stable
"""
- OptionA = "OptionA"
+ OPTION_A = "OPTION_A"
"""
Stability:
stable
"""
- OptionB = "OptionB"
+ OPTION_B = "OPTION_B"
"""
Stability:
stable
@@ -5713,13 +5713,13 @@ class CompositionStringStyle(enum.Enum):
Stability:
experimental
"""
- Normal = "Normal"
+ NORMAL = "NORMAL"
"""Normal string expression.
Stability:
experimental
"""
- Decorated = "Decorated"
+ DECORATED = "DECORATED"
"""Decorated string expression.
Stability:
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst
index 151d4708cd..61da53ff0a 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst
+++ b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst
@@ -538,11 +538,11 @@ AllTypesEnum (enum)
- .. py:data:: MyEnumValue
+ .. py:data:: MY_ENUM_VALUE
- .. py:data:: YourEnumValue
+ .. py:data:: YOUR_ENUM_VALUE
- .. py:data:: ThisIsGreat
+ .. py:data:: THIS_IS_GREAT
AllowedMethodNames
@@ -1562,9 +1562,9 @@ DeprecatedEnum (enum)
- .. py:data:: OptionA
+ .. py:data:: OPTION_A
- .. py:data:: OptionB
+ .. py:data:: OPTION_B
DeprecatedStruct (interface)
@@ -2198,9 +2198,9 @@ ExperimentalEnum (enum)
- .. py:data:: OptionA
+ .. py:data:: OPTION_A
- .. py:data:: OptionB
+ .. py:data:: OPTION_B
ExperimentalStruct (interface)
@@ -5905,7 +5905,7 @@ SingletonIntEnum (enum)
- .. py:data:: SingletonInt
+ .. py:data:: SINGLETON_INT
Elite!
@@ -5986,7 +5986,7 @@ SingletonStringEnum (enum)
- .. py:data:: SingletonString
+ .. py:data:: SINGLETON_STRING
1337.
@@ -6066,9 +6066,9 @@ StableEnum (enum)
- .. py:data:: OptionA
+ .. py:data:: OPTION_A
- .. py:data:: OptionB
+ .. py:data:: OPTION_B
StableStruct (interface)
@@ -7133,13 +7133,13 @@ CompositeOperation
- .. py:data:: Normal
+ .. py:data:: NORMAL
Normal string expression.
- .. py:data:: Decorated
+ .. py:data:: DECORATED
Decorated string expression.
diff --git a/packages/jsii-python-runtime/tests/test_compliance.py b/packages/jsii-python-runtime/tests/test_compliance.py
index 4ba2ffe6d5..bb66566bcf 100644
--- a/packages/jsii-python-runtime/tests/test_compliance.py
+++ b/packages/jsii-python-runtime/tests/test_compliance.py
@@ -343,21 +343,21 @@ def test_getAndSetEnumValues():
CompositeOperation = composition.CompositeOperation
- assert calc.string_style == CompositeOperation.CompositionStringStyle.Normal
+ assert calc.string_style == CompositeOperation.CompositionStringStyle.NORMAL
- calc.string_style = CompositeOperation.CompositionStringStyle.Decorated
+ calc.string_style = CompositeOperation.CompositionStringStyle.DECORATED
- assert calc.string_style == CompositeOperation.CompositionStringStyle.Decorated
+ assert calc.string_style == CompositeOperation.CompositionStringStyle.DECORATED
assert calc.to_string() == "<<[[{{(((1 * (0 + 9)) * (0 + 9)) * (0 + 9))}}]]>>"
def test_useEnumFromScopedModule():
obj = ReferenceEnumFromScopedPackage()
- assert obj.foo == EnumFromScopedModule.Value2
- obj.foo = EnumFromScopedModule.Value1
- assert obj.load_foo() == EnumFromScopedModule.Value1
- obj.save_foo(EnumFromScopedModule.Value2)
- assert obj.foo == EnumFromScopedModule.Value2
+ assert obj.foo == EnumFromScopedModule.VALUE2
+ obj.foo = EnumFromScopedModule.VALUE1
+ assert obj.load_foo() == EnumFromScopedModule.VALUE1
+ obj.save_foo(EnumFromScopedModule.VALUE2)
+ assert obj.foo == EnumFromScopedModule.VALUE2
def test_undefinedAndNull():
@@ -890,7 +890,7 @@ class PartiallyInitializedThisConsumerImpl(PartiallyInitializedThisConsumer):
def consume_partially_initialized_this(self, obj, dt, en):
assert obj is not None
assert isinstance(dt, datetime)
- assert en.member == AllTypesEnum.ThisIsGreat.value
+ assert en.member == AllTypesEnum.THIS_IS_GREAT.value
return "OK"
reflector = PartiallyInitializedThisConsumerImpl()
diff --git a/packages/jsii-reflect/actual.txt b/packages/jsii-reflect/actual.txt
index bf6751fec7..7df10da8b9 100644
--- a/packages/jsii-reflect/actual.txt
+++ b/packages/jsii-reflect/actual.txt
@@ -1107,16 +1107,16 @@ assemblies
│ │ ├── abstract
│ │ └── type: primitive:string | primitive:number
│ ├─┬ AllTypesEnum enum
- │ │ ├── MyEnumValue
- │ │ ├── YourEnumValue
- │ │ └── ThisIsGreat
+ │ │ ├── MY_ENUM_VALUE
+ │ │ ├── YOUR_ENUM_VALUE
+ │ │ └── THIS_IS_GREAT
│ ├─┬ StringEnum enum
│ │ ├── A
│ │ ├── B
│ │ └── C
│ └─┬ CompositionStringStyle enum
- │ ├── Normal
- │ └── Decorated
+ │ ├── NORMAL
+ │ └── DECORATED
├─┬ @scope/jsii-calc-base
│ ├─┬ dependencies
│ │ └── @scope/jsii-calc-base-of-base
@@ -1219,5 +1219,5 @@ assemblies
│ ├── abstract
│ └── type: primitive:boolean (optional)
└─┬ EnumFromScopedModule enum
- ├── Value1
- └── Value2
+ ├── VALUE1
+ └── VALUE2
diff --git a/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt
index e813402066..5cd76b3f67 100644
--- a/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt
+++ b/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt
@@ -1593,29 +1593,29 @@ assemblies
│ │ ├── immutable
│ │ └── type: Optional
│ ├─┬ enum AllTypesEnum
- │ │ ├── MyEnumValue
- │ │ ├── YourEnumValue
- │ │ └── ThisIsGreat
+ │ │ ├── MY_ENUM_VALUE
+ │ │ ├── YOUR_ENUM_VALUE
+ │ │ └── THIS_IS_GREAT
│ ├─┬ enum DeprecatedEnum
- │ │ ├── OptionA
- │ │ └── OptionB
+ │ │ ├── OPTION_A
+ │ │ └── OPTION_B
│ ├─┬ enum ExperimentalEnum
- │ │ ├── OptionA
- │ │ └── OptionB
+ │ │ ├── OPTION_A
+ │ │ └── OPTION_B
│ ├─┬ enum SingletonIntEnum
- │ │ └── SingletonInt
+ │ │ └── SINGLETON_INT
│ ├─┬ enum SingletonStringEnum
- │ │ └── SingletonString
+ │ │ └── SINGLETON_STRING
│ ├─┬ enum StableEnum
- │ │ ├── OptionA
- │ │ └── OptionB
+ │ │ ├── OPTION_A
+ │ │ └── OPTION_B
│ ├─┬ enum StringEnum
│ │ ├── A
│ │ ├── B
│ │ └── C
│ └─┬ enum CompositionStringStyle
- │ ├── Normal
- │ └── Decorated
+ │ ├── NORMAL
+ │ └── DECORATED
├─┬ @scope/jsii-calc-base
│ ├─┬ dependencies
│ │ └── @scope/jsii-calc-base-of-base
@@ -1740,5 +1740,5 @@ assemblies
│ ├── immutable
│ └── type: Optional
└─┬ enum EnumFromScopedModule
- ├── Value1
- └── Value2
+ ├── VALUE1
+ └── VALUE2
diff --git a/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt
index 6f0e05404e..befa545763 100644
--- a/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt
+++ b/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt
@@ -707,29 +707,29 @@ assemblies
│ │ ├── bar property
│ │ └── foo property
│ ├─┬ enum AllTypesEnum
- │ │ ├── MyEnumValue
- │ │ ├── YourEnumValue
- │ │ └── ThisIsGreat
+ │ │ ├── MY_ENUM_VALUE
+ │ │ ├── YOUR_ENUM_VALUE
+ │ │ └── THIS_IS_GREAT
│ ├─┬ enum DeprecatedEnum
- │ │ ├── OptionA
- │ │ └── OptionB
+ │ │ ├── OPTION_A
+ │ │ └── OPTION_B
│ ├─┬ enum ExperimentalEnum
- │ │ ├── OptionA
- │ │ └── OptionB
+ │ │ ├── OPTION_A
+ │ │ └── OPTION_B
│ ├─┬ enum SingletonIntEnum
- │ │ └── SingletonInt
+ │ │ └── SINGLETON_INT
│ ├─┬ enum SingletonStringEnum
- │ │ └── SingletonString
+ │ │ └── SINGLETON_STRING
│ ├─┬ enum StableEnum
- │ │ ├── OptionA
- │ │ └── OptionB
+ │ │ ├── OPTION_A
+ │ │ └── OPTION_B
│ ├─┬ enum StringEnum
│ │ ├── A
│ │ ├── B
│ │ └── C
│ └─┬ enum CompositionStringStyle
- │ ├── Normal
- │ └── Decorated
+ │ ├── NORMAL
+ │ └── DECORATED
├─┬ @scope/jsii-calc-base
│ └─┬ types
│ ├─┬ class Base
@@ -790,5 +790,5 @@ assemblies
│ ├── optional2 property
│ └── optional3 property
└─┬ enum EnumFromScopedModule
- ├── Value1
- └── Value2
+ ├── VALUE1
+ └── VALUE2
diff --git a/packages/jsii-reflect/test/tree.expected.txt b/packages/jsii-reflect/test/tree.expected.txt
index bf6751fec7..7df10da8b9 100644
--- a/packages/jsii-reflect/test/tree.expected.txt
+++ b/packages/jsii-reflect/test/tree.expected.txt
@@ -1107,16 +1107,16 @@ assemblies
│ │ ├── abstract
│ │ └── type: primitive:string | primitive:number
│ ├─┬ AllTypesEnum enum
- │ │ ├── MyEnumValue
- │ │ ├── YourEnumValue
- │ │ └── ThisIsGreat
+ │ │ ├── MY_ENUM_VALUE
+ │ │ ├── YOUR_ENUM_VALUE
+ │ │ └── THIS_IS_GREAT
│ ├─┬ StringEnum enum
│ │ ├── A
│ │ ├── B
│ │ └── C
│ └─┬ CompositionStringStyle enum
- │ ├── Normal
- │ └── Decorated
+ │ ├── NORMAL
+ │ └── DECORATED
├─┬ @scope/jsii-calc-base
│ ├─┬ dependencies
│ │ └── @scope/jsii-calc-base-of-base
@@ -1219,5 +1219,5 @@ assemblies
│ ├── abstract
│ └── type: primitive:boolean (optional)
└─┬ EnumFromScopedModule enum
- ├── Value1
- └── Value2
+ ├── VALUE1
+ └── VALUE2
diff --git a/packages/jsii/lib/validator.ts b/packages/jsii/lib/validator.ts
index 2ff4c5895a..1fbecc2836 100644
--- a/packages/jsii/lib/validator.ts
+++ b/packages/jsii/lib/validator.ts
@@ -54,6 +54,7 @@ export type ValidationFunction = (validator: Validator,
function _defaultValidations(): ValidationFunction[] {
return [
_typeNamesMustUsePascalCase,
+ _enumMembersMustUserUpperSnakeCase,
_memberNamesMustUseCamelCase,
_staticConstantNamesMustUseUpperSnakeCase,
_memberNamesMustNotLookLikeJavaGettersOrSetters,
@@ -70,6 +71,19 @@ function _defaultValidations(): ValidationFunction[] {
}
}
+ function _enumMembersMustUserUpperSnakeCase(_: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {
+ for (const type of _allTypes(assembly)) {
+ if (!spec.isEnumType(type)) { continue; }
+
+ for (const member of type.members) {
+ if (member.name && member.name !== Case.constant(member.name)) {
+ diagnostic(ts.DiagnosticCategory.Error,
+ `Enum members must use ALL_CAPS: ${member.name}`);
+ }
+ }
+ }
+ }
+
function _memberNamesMustUseCamelCase(_: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {
for (const member of _allMembers(assembly)) {
if (member.static && (member as spec.Property).const) { continue; }
diff --git a/packages/jsii/test/negatives/neg.enum-members.1.ts b/packages/jsii/test/negatives/neg.enum-members.1.ts
new file mode 100644
index 0000000000..5e3eae81a0
--- /dev/null
+++ b/packages/jsii/test/negatives/neg.enum-members.1.ts
@@ -0,0 +1,6 @@
+///!MATCH_ERROR: Enum members must use ALL_CAPS: Goo
+
+export enum MyEnum {
+ FOO,
+ Goo
+}
diff --git a/packages/jsii/test/negatives/neg.enum-name.1.ts b/packages/jsii/test/negatives/neg.enum-name.1.ts
index fdc8195e85..6b7732ee76 100644
--- a/packages/jsii/test/negatives/neg.enum-name.1.ts
+++ b/packages/jsii/test/negatives/neg.enum-name.1.ts
@@ -1,6 +1,6 @@
///!MATCH_ERROR: Type names must use PascalCase: myEnum
export enum myEnum {
- Foo,
- Goo
+ FOO,
+ GOO
}
diff --git a/packages/jsii/test/negatives/neg.enum-name.2.ts b/packages/jsii/test/negatives/neg.enum-name.2.ts
index fa2acd7b2e..096cf4b267 100644
--- a/packages/jsii/test/negatives/neg.enum-name.2.ts
+++ b/packages/jsii/test/negatives/neg.enum-name.2.ts
@@ -1,6 +1,6 @@
///!MATCH_ERROR: Type names must use PascalCase: My_Enum
export enum My_Enum {
- Foo,
- Goo
+ FOO,
+ GOO
}
diff --git a/packages/jsii/test/test.enums.ts b/packages/jsii/test/test.enums.ts
index 2552fbfde0..f148ef784b 100644
--- a/packages/jsii/test/test.enums.ts
+++ b/packages/jsii/test/test.enums.ts
@@ -8,8 +8,8 @@ export = {
async 'test parsing enum with two members and no values'(test: Test) {
const assembly = await sourceToAssemblyHelper(`
export enum Foo {
- Bar,
- Baz
+ BAR,
+ BAZ
}
`);
@@ -17,7 +17,7 @@ export = {
assembly: 'testpkg',
fqn: 'testpkg.Foo',
kind: 'enum',
- members: [{ name: 'Bar' }, { name: 'Baz' }],
+ members: [{ name: 'BAR' }, { name: 'BAZ' }],
locationInModule: { filename: 'index.ts', line: 2 },
name: 'Foo'
});
@@ -29,8 +29,8 @@ export = {
async 'test parsing enum with two members and assigned values'(test: Test) {
const assembly = await sourceToAssemblyHelper(`
export enum Foo {
- Bar = 'Bar',
- Baz = 'Baz'
+ BAR = 'Bar',
+ BAZ = 'Baz'
}
`);
@@ -38,7 +38,7 @@ export = {
assembly: 'testpkg',
fqn: 'testpkg.Foo',
kind: 'enum',
- members: [{ name: 'Bar' }, { name: 'Baz' }],
+ members: [{ name: 'BAR' }, { name: 'BAZ' }],
locationInModule: { filename: 'index.ts', line: 2 },
name: 'Foo'
});