Skip to content

Commit b07fc9c

Browse files
author
Gopal S Akshintala
committed
Add style.mdc
Signed-off-by: Gopal S Akshintala <gopala.akshintala@salesforce.com> Signed-off-by: Gopal S Akshintala <gopala.akshintala+sfemu@salesforce.com>
1 parent 4122e00 commit b07fc9c

5 files changed

Lines changed: 8 additions & 13 deletions

File tree

.cursor/style.mdc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22
alwaysApply: true
33
---
44

5-
- Use this codebase's functional Kotlin style: pure functions, sequences, immutable state, when expressions
6-
- Reduce state mutation as much as possible. Prefer state transformation
7-
- While generating Kotlin code, specify all variable types and functional return types explicitly
8-
95
# Functional Programming Patterns
106

11-
- Keep functional code simple: avoid nested functions, unnecessary data classes, and over-engineered chains
7+
- Reduce state mutation as much as possible. Prefer state transformation
128
- Follow the functional style from the existing codebase
139
- Chain operations using sequences: prefer `.asSequence()` for multiple transformations
10+
- Avoid imperative loops if possible
1411
- Build immutable data flow: pass state through parameters, return new state instead of mutating
1512
- Use functional combinators: `map`, `filter`, `flatMap`, `fold`, `firstOrNull` over loops
1613
- Prefer single-expression functions that return directly from when/if expressions
1714
- Prefer direct recursion with parameters over complex state objects
15+
- Don't over-engineer functional programming code
1816

1917
# Kotlin-Specific Patterns
20-
- Always use `when` expressions over if-else chains
18+
- Always use `when` expressions over `if-else` chains
2119
- Use ranges: `downTo`, `until`, `in`, `indices` for iterations
2220
- String operations: use `substring(range)` with IntRange, not separate indices
2321
- Choose `firstOrNull` over complex sequence chains when finding first valid element
2422
- Collection operations: use `+` operator for adding to immutable collections
2523
- Use `?.let { }` with elvis `?:` for clean null handling
2624
- Use `firstOrNull()` with elvis `?:` for fallback values
25+
- While generating Kotlin code, specify all variable types and functional return types explicitly. Use Named parameters only in ambiguous situations

.idea/vcs.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ plugins {
1818
val mockitoAgent = configurations.create("mockitoAgent")
1919

2020
dependencies {
21-
implementation(libs.koog.agents)
2221
api(platform(libs.http4k.bom))
2322
api(libs.bundles.http4k)
2423
api(libs.moshix.adapters)

settings.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,4 @@ develocity {
4545
}
4646
}
4747

48-
includeBuild("../../.") {
49-
name = "koog"
50-
}
51-
5248
rootProject.name = "revoman-root"

src/main/kotlin/com/salesforce/revoman/internal/postman/PostmanSDK.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import org.graalvm.polyglot.Context
2222
import org.graalvm.polyglot.HostAccess
2323
import org.graalvm.polyglot.Source
2424
import org.graalvm.polyglot.Value
25+
import org.graalvm.polyglot.io.IOAccess
2526
import org.intellij.lang.annotations.Language
2627

2728
/**
@@ -69,8 +70,7 @@ class PostmanSDK(
6970
jsContext =
7071
Context.newBuilder("js")
7172
.allowExperimentalOptions(true)
72-
// ! TODO 07 Dec 2024 gopala.akshintala: Using this for core compatability
73-
.allowIO(true)
73+
.allowIO(IOAccess.ALL)
7474
.allowExperimentalOptions(true)
7575
.options(options)
7676
.allowHostAccess(HostAccess.ALL)

0 commit comments

Comments
 (0)