Skip to content

Commit 2297098

Browse files
Merge origin/main into renovate/maven-enforcer-plugin.version
2 parents abd9d9e + 69088ac commit 2297098

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ Detailed build and testing instructions can be found in [BUILDANDTEST.md](./BUIL
4646

4747
Troubleshooting: If you run into issues, please open an [issue](https://github.com/finos/rune-python-generator/issues). This helps us improve the guide for everyone.
4848

49+
### Coding Standards
50+
51+
- Indentation: Since Python is sensitive to indentation, ensure your submission uses four spaces for each indentation instead of tabs.
52+
- Java vs xTend: since the intention is to replace xTend, all new code should be written in Java. Ideally, changes to existing code will migrate xTend code to Java.
53+
4954
### 1. Building with Maven
5055

5156
Start by cloning the project: `git clone https://github.com/finos/rune-python-generator`
@@ -109,7 +114,9 @@ We welcome contributions! Please follow these steps to get started:
109114
3. Read our [contribution guidelines](.github/CONTRIBUTING.md) and [Community Code of Conduct](https://www.finos.org/code-of-conduct)
110115
4. Commit your changes (`git commit -am 'Add some fooBar'`)
111116
5. Push to the branch (`git push origin feature/fooBar`)
112-
6. Create a new Pull Request
117+
6. Create a new Pull Request: the intention is to ensure that Main is always production ready and matches a release.
118+
- Simple / short running changes : the PR should be to Main
119+
- Complex / long running changes: the recommendation is to complete all the changes in a staging branch, such as Develop or another branch of your choosing. Once the change is complete and passes all tests, then raise the PR to main from your staging branch.
113120

114121
**NOTE: FINOS repositories require an executed and active FINOS Individual Contributor License Agreement (ICLA) or an executed and active FINOS Corporate Contribution License Agreement (CCLA). The FINOS Clabot tool (or EasyCLA) will flag and block commits from individuals not covered. Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.**
115122

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<repoServerHost>s01.oss.sonatype.org</repoServerHost>
8282
<stagingTimeoutInMinutes>20</stagingTimeoutInMinutes>
8383

84-
<rosetta.dsl.version>9.68.0</rosetta.dsl.version>
84+
<rosetta.dsl.version>9.71.0</rosetta.dsl.version>
8585

8686
<xtext.version>2.38.0</xtext.version>
8787
<guice.version>6.0.0</guice.version>

src/main/java/com/regnosys/rosetta/generator/python/expressions/PythonExpressionGenerator.xtend

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import com.regnosys.rosetta.rosetta.expression.RosettaIntLiteral
3232
import com.regnosys.rosetta.rosetta.expression.RosettaNumberLiteral
3333
import com.regnosys.rosetta.rosetta.expression.RosettaOnlyElement
3434
import com.regnosys.rosetta.rosetta.expression.RosettaOnlyExistsExpression
35-
import com.regnosys.rosetta.rosetta.expression.RosettaReference
3635
import com.regnosys.rosetta.rosetta.expression.RosettaStringLiteral
3736
import com.regnosys.rosetta.rosetta.expression.RosettaSymbolReference
3837
import com.regnosys.rosetta.rosetta.expression.SortOperation
@@ -109,7 +108,8 @@ class PythonExpressionGenerator {
109108
RosettaFeatureCall: generateFeatureCall(expr, ifLevel, isLambda)
110109
RosettaOnlyElement: '''rune_get_only_element(«generateExpression(expr.argument, ifLevel, isLambda)»)'''
111110
RosettaOnlyExistsExpression: '''rune_check_one_of(self, «generateExpression(expr.getArgs().get(0), ifLevel, isLambda)»)'''
112-
RosettaReference: generateReference(expr, ifLevel, isLambda)
111+
RosettaSymbolReference: generateSymbolReference(expr, ifLevel, isLambda)
112+
RosettaImplicitVariable: generateImplicitVariable(expr, ifLevel, isLambda)
113113
default:{
114114
throw new UnsupportedOperationException("Unsupported expression type of " + expr?.class?.simpleName)
115115
}
@@ -260,12 +260,8 @@ class PythonExpressionGenerator {
260260
return _builder.toString
261261
}
262262

263-
264-
private def String generateReference(RosettaReference expr, int ifLevel, boolean isLambda) {
265-
switch (expr) {
266-
RosettaImplicitVariable: '''«expr.name»'''
267-
RosettaSymbolReference: generateSymbolReference(expr, ifLevel, isLambda)
268-
}
263+
private def String generateImplicitVariable(RosettaImplicitVariable expr, int ifLevel, boolean isLambda) {
264+
'''«expr.name»'''
269265
}
270266

271267
private def String generateSymbolReference(RosettaSymbolReference expr, int ifLevel, boolean isLambda) {

src/main/java/com/regnosys/rosetta/generator/python/func/FunctionDependencyProvider.xtend

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import com.regnosys.rosetta.rosetta.expression.RosettaFeatureCall
1616
import com.regnosys.rosetta.rosetta.expression.RosettaFunctionalOperation
1717
import com.regnosys.rosetta.rosetta.expression.RosettaLiteral
1818
import com.regnosys.rosetta.rosetta.expression.RosettaOnlyExistsExpression
19-
import com.regnosys.rosetta.rosetta.expression.RosettaReference
19+
import com.regnosys.rosetta.rosetta.expression.RosettaImplicitVariable
2020
import com.regnosys.rosetta.rosetta.expression.RosettaSymbolReference
2121
import com.regnosys.rosetta.rosetta.expression.RosettaUnaryOperation
2222
import com.regnosys.rosetta.rosetta.expression.RosettaDeepFeatureCall
@@ -94,7 +94,7 @@ class FunctionDependencyProvider {
9494
RosettaExternalFunction,
9595
RosettaEnumValueReference,
9696
RosettaLiteral,
97-
RosettaReference,
97+
RosettaImplicitVariable,
9898
RosettaSymbol,
9999
RosettaDeepFeatureCall:
100100
dependencies = newHashSet()

0 commit comments

Comments
 (0)