forked from typelevel/feral
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dbc728
commit 567b05c
Showing
8 changed files
with
82 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
scalafix/input/src/main/scala/example/RenameLambdaEnvToInvocation.scala
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
scalafix/input/src/main/scala/example/V0_3_0Rewrites.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* rule=V0_3_0Rewrites */ | ||
|
||
package example | ||
|
||
import feral.lambda.LambdaEnv | ||
import feral.lambda.ApiGatewayProxyLambdaEnv | ||
import feral.lambda.DynamoDbStreamLambdaEnv | ||
import feral.lambda.S3BatchLambdaEnv | ||
import feral.lambda.SnsLambdaEnv | ||
import feral.lambda.SqsLambdaEnv | ||
import feral.lambda.events.APIGatewayProxyRequestEvent | ||
import feral.lambda.events.APIGatewayProxyResponseEvent | ||
|
||
class Foo[F[_], E] { | ||
|
||
def bar(implicit env: LambdaEnv[F, E]): Unit = ??? | ||
|
||
} | ||
|
||
object Handlers { | ||
def handler1[F[_]](implicit env: ApiGatewayProxyLambdaEnv[F]): Unit = ??? | ||
def handler2[F[_]](implicit env: DynamoDbStreamLambdaEnv[F]): Unit = ??? | ||
def handler3[F[_]](implicit env: S3BatchLambdaEnv[F]): Unit = ??? | ||
def handler4[F[_]](implicit env: SnsLambdaEnv[F]): Unit = ??? | ||
def handler5[F[_]](implicit env: SqsLambdaEnv[F]): Unit = ??? | ||
def handler6(event: APIGatewayProxyRequestEvent): APIGatewayProxyResponseEvent = ??? | ||
} |
9 changes: 0 additions & 9 deletions
9
scalafix/output/src/main/scala/example/RenameLambdaEnvToInvocation.scala
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
scalafix/output/src/main/scala/example/V0_3_0Rewrites.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package example | ||
|
||
import feral.lambda.{ ApiGatewayProxyV2Invocation, DynamoDbStreamInvocation, Invocation, S3BatchInvocation, SnsInvocation, SqsInvocation } | ||
import feral.lambda.events.{ ApiGatewayProxyEvent, ApiGatewayProxyResult } | ||
|
||
class Foo[F[_], E] { | ||
|
||
def bar(implicit env: Invocation[F, E]): Unit = ??? | ||
|
||
} | ||
|
||
object Handlers { | ||
def handler1[F[_]](implicit env: ApiGatewayProxyV2Invocation[F]): Unit = ??? | ||
def handler2[F[_]](implicit env: DynamoDbStreamInvocation[F]): Unit = ??? | ||
def handler3[F[_]](implicit env: S3BatchInvocation[F]): Unit = ??? | ||
def handler4[F[_]](implicit env: SnsInvocation[F]): Unit = ??? | ||
def handler5[F[_]](implicit env: SqsInvocation[F]): Unit = ??? | ||
def handler6(event: ApiGatewayProxyEvent): ApiGatewayProxyResult = ??? | ||
} |
2 changes: 1 addition & 1 deletion
2
scalafix/rules/src/main/resources/META-INF/services/scalafix.v1.Rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
feral.scalafix.RenameLambdaEnvToInvocation | ||
feral.scalafix.V0_3_0Rewrites |
24 changes: 0 additions & 24 deletions
24
scalafix/rules/src/main/scala/feral/scalafix/RenameLambdaEnvToInvocation.scala
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
scalafix/rules/src/main/scala/feral/scalafix/V0_3_0Rewrites.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2023 Typelevel | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package feral.scalafix | ||
|
||
import scalafix.v1._ | ||
|
||
class V0_3_0Rewrites extends SemanticRule("V0_3_0Rewrites") { | ||
override def fix(implicit doc: SemanticDocument): Patch = | ||
Patch.replaceSymbols( | ||
"feral.lambda.LambdaEnv" -> "feral.lambda.Invocation", | ||
"feral.lambda.ApiGatewayProxyLambdaEnv" -> "feral.lambda.ApiGatewayProxyV2Invocation", | ||
"feral.lambda.DynamoDbStreamLambdaEnv" -> "feral.lambda.DynamoDbStreamInvocation", | ||
"feral.lambda.S3BatchLambdaEnv" -> "feral.lambda.S3BatchInvocation", | ||
"feral.lambda.SnsLambdaEnv" -> "feral.lambda.SnsInvocation", | ||
"feral.lambda.SqsLambdaEnv" -> "feral.lambda.SqsInvocation", | ||
"feral.lambda.events.APIGatewayProxyRequestEvent" -> "feral.lambda.events.ApiGatewayProxyEvent", | ||
"feral.lambda.events.APIGatewayProxyResponseEvent" -> "feral.lambda.events.ApiGatewayProxyResult" | ||
) | ||
} |