starknet-rs icon indicating copy to clipboard operation
starknet-rs copied to clipboard

Add linters

Open aniketpr01 opened this issue 1 year ago • 7 comments
trafficstars

PR: https://github.com/xJonathanLEI/starknet-rs/issues/596

Add linters as referenced from reth repo with below exceptions which can be added later. Exceptions till now: rust.missing_docs = "allow" rust.unreachable_pub = "allow" type-repetition-in-bound = "allow"

Added PR to ignore linter changes affecting codegen.rs PR: https://github.com/xJonathanLEI/starknet-jsonrpc-codegen/pull/5

aniketpr01 avatar Jun 06 '24 06:06 aniketpr01

Looks good to me, just two remarks:

  • For the codegen file, this should be handle directly at source, can you confirm @xJonathanLEI ?
  • Can you rebase on main?

tcoratger avatar Jun 17 '24 13:06 tcoratger

lgtm @xJonathanLEI what about codegen file?

tcoratger avatar Jun 17 '24 17:06 tcoratger

@tcoratger Yes the codegen file should not be modified in any case, as any codegen update will overwrite all the changes.

@aniketpr01 Please make changes to xJonathanLEI/starknet-jsonrpc-codegen such that the codegen output matches exactly what this PR does to that file.

xJonathanLEI avatar Jun 19 '24 23:06 xJonathanLEI

@tcoratger Yes the codegen file should not be modified in any case, as any codegen update will overwrite all the changes.

@aniketpr01 Please make changes to xJonathanLEI/starknet-jsonrpc-codegen such that the codegen output matches exactly what this PR does to that file.

@xJonathanLEI should i keep the codegen changes as it is in this repo and perform same changes to starknet-jsonrpc-codegen by creating a seperate PR to it? How do i ensure that codegen output matches exactly? by just changing codegen file or adding all the linters that are added for starknet-rs as well to that?

aniketpr01 avatar Jun 20 '24 11:06 aniketpr01

should i keep the codegen changes as it is in this repo and perform same changes to starknet-jsonrpc-codegen by creating a seperate PR to it?

Yes please.

How do i ensure that codegen output matches exactly? by just changing codegen file or adding all the linters that are added for starknet-rs as well to that?

You can run the generate command and overwrite the file to this PR branch to see if you generate any diff. You should only be seeing a single line of commit hash diff.

An alternative solution would be to exclude the codegen file from the lints. Not sure if that's desirable though, as some lints actually affect the API (e.g. const).

xJonathanLEI avatar Jun 21 '24 00:06 xJonathanLEI

should i keep the codegen changes as it is in this repo and perform same changes to starknet-jsonrpc-codegen by creating a seperate PR to it?

Yes please.

How do i ensure that codegen output matches exactly? by just changing codegen file or adding all the linters that are added for starknet-rs as well to that?

You can run the generate command and overwrite the file to this PR branch to see if you generate any diff. You should only be seeing a single line of commit hash diff.

An alternative solution would be to exclude the codegen file from the lints. Not sure if that's desirable though, as some lints actually affect the API (e.g. const).

@xJonathanLEI Could you please respond the Telegram DM i have sent for a doubt over working with starknet-jsonrpc-codegen repo

aniketpr01 avatar Jun 26 '24 09:06 aniketpr01

should i keep the codegen changes as it is in this repo and perform same changes to starknet-jsonrpc-codegen by creating a seperate PR to it?

Yes please.

How do i ensure that codegen output matches exactly? by just changing codegen file or adding all the linters that are added for starknet-rs as well to that?

You can run the generate command and overwrite the file to this PR branch to see if you generate any diff. You should only be seeing a single line of commit hash diff.

An alternative solution would be to exclude the codegen file from the lints. Not sure if that's desirable though, as some lints actually affect the API (e.g. const).

Have reverted codegen.rs from this(starknet-rs) repo and added another PR which will exclude existing rules to it. PR: https://github.com/xJonathanLEI/starknet-jsonrpc-codegen/pull/5 Please review @xJonathanLEI

aniketpr01 avatar Jun 27 '24 09:06 aniketpr01

Squashed and rebased.

xJonathanLEI avatar Jul 16 '24 05:07 xJonathanLEI