Skip to content

lint fixes#131

Merged
mts1715 merged 18 commits into
mainfrom
taras/lint-fixes
Mar 3, 2026
Merged

lint fixes#131
mts1715 merged 18 commits into
mainfrom
taras/lint-fixes

Conversation

@mts1715

@mts1715 mts1715 commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Note: should be merged before fix wrong authorization PR #143

  • fixed problems that was found by flow cadence lint.
  • added lint stage before test stage in the CI workflow

Update: problem bellow was solved in onflow/cadence-tools#586 .

But some problems were left unresolved due to a bug with the linter:

var out: [UInt8] = []    // type annotation is redundant, type can be inferred
var out = []             // cannot infer type: requires an explicit type annotation. add an explicit type annotation to resolve the ambiguity
var out = [] as [UInt8]  // static cast is redundant

Also, it's impossible to use a long string template across multiple lines, so in order to prevent long lines, it should be written like this:

panic("Deposit token type \(self.depositVaultType.identifier) has not been onboarded to the VM bridge - "
                .concat("Ensure the Cadence token type is associated with an EVM contract via the VM bridge"))

But the linter suggests: string concatenation can be replaced with string template

@vishalchangrani vishalchangrani requested a review from a team February 4, 2026 18:57
@mts1715 mts1715 self-assigned this Feb 5, 2026
# Conflicts:
#	cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc
#	cadence/tests/UniswapV3SwapConnectors_test.cdc
Comment thread Makefile Outdated
@mts1715 mts1715 requested a review from holyfuchs February 23, 2026 11:41
# Conflicts:
#	cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc

@SupunS SupunS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall!
Left a few suggestions for using the type-annotation over casting/conversion.

Comment thread cadence/contracts/connectors/evm/UniswapV2SwapConnectors.cdc Outdated
Comment thread cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc Outdated
Comment thread cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc Outdated
Comment thread cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc Outdated
Comment thread cadence/contracts/connectors/evm/UniswapV3SwapConnectors.cdc Outdated

@turbolent turbolent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for cleaning this up

Comment thread cadence/contracts/connectors/evm/morpho/MorphoERC4626SinkConnectors.cdc Outdated
Comment thread cadence/contracts/connectors/evm/UniswapV2SwapConnectors.cdc Outdated
Comment thread cadence/tests/transactions/attempt_copy_auto_balancer_config.cdc
@mts1715 mts1715 requested review from SupunS and turbolent March 2, 2026 17:39

@SupunS SupunS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Seems there's still an open question from Bastian ragarding the authorization/entitlements change. Apart from that, everything else looks good!

Comment thread cadence/transactions/fungible-tokens/setup_generic_vault.cdc Outdated
Comment thread cadence/tests/test_helpers.cdc Outdated
Comment thread cadence/tests/test_helpers.cdc Outdated
@mts1715 mts1715 merged commit 78ee361 into main Mar 3, 2026
3 checks passed
@mts1715 mts1715 deleted the taras/lint-fixes branch March 3, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants