Skip to content

Add auto-fix implementation for deprecated functions regarding gnolang/gno PR #3374 #142

Description

@stefann-01

Following PR #3374, tlin now successfully identifies deprecated functions, but the -fix flag doesn't actually implement the suggested replacements.

For example:

stefan@DESKTOP-27RFF3F:gno/examples/gno.land/r/gnolend$ tlin -fix ./gnolend.gno
Fixed issues in ./gnolend.gno
stefan@DESKTOP-27RFF3F:gno/examples/gno.land/r/gnolend$ tlin ./
error: deprecated
  --> gnolend.gno:95:12
   |
95 | caller := std.PrevRealm().Addr()
   |           ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = Use of deprecated function. please use Address instead.

suggestion:
   |
95 | Address
   |

error: deprecated
  --> gnolend.gno:95:12
   |
95 | caller := std.PrevRealm().Addr()
   |           ^^^^^^^^^^^^^^^^
   |
   = Use of deprecated function. please use std.PreviousRealm instead.

suggestion:
   |
95 | std.PreviousRealm
   |

The -fix flag should automatically implement these suggested replacements to make the migration process smoother. Currently users have to manually replace each deprecated function even after running tlin -fix.

Metadata

Metadata

Assignees

Labels

L-suggestionLint: improving, adding or fixing lint suggestionT-fixerType: Auto fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions