简体   繁体   English

在多个 AWS Lambda 中处理相同的 function 名称

[英]Handling same function names in multiple AWS Lambdas

I have a BitBucket repo which holds code for multiple lambda functions in separate folders.我有一个 BitBucket 存储库,它在不同的文件夹中包含多个 lambda 函数的代码。 In two of the folders (belonging to separate lambdas), I'm using a same Python function name which has different number of arguments on different lambdas.在两个文件夹(属于单独的 lambda)中,我使用相同的 Python function 名称,在不同的 lambda 上具有不同数量的 arguments

This is being identified by Sonar as a bug. Sonar 将其识别为错误。

How do I handle my lambdas in such a scenario?在这种情况下如何处理我的 lambda? Changing the name of the function in either of the lambdas is difficult to implement as I have references to this function from multiple places.在任何一个 lambda 中更改 function 的名称都很难实现,因为我从多个地方引用了这个 function。 Can I edit my Sonar ruleset to accomodate these cases?我可以编辑我的 Sonar 规则集以适应这些情况吗?

Personally I would do a separate SQ project for each lambda, so that SQ does not mix up code belonging to different projects.我个人会为每个 lambda 做一个单独的 SQ 项目,这样 SQ 就不会混淆属于不同项目的代码。 My own best practice is that SQ should reflect the code that you build, not the code that you store (ie create SQ projects by projects outcome, not by Git repositories).我自己的最佳实践是 SQ 应该反映您构建的代码,而不是您存储的代码(即按项目结果创建 SQ 项目,而不是按 Git 存储库)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM