-
Notifications
You must be signed in to change notification settings - Fork 480
Linter: Warn when number primitive is annotated with #[ink(topic)]
#1837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7ca2cf7
The initial structure of the linting crate and tests
574fc18
Implement the lint that checks primitive types in expanded code
jubnzv 0938d13
The initial implementation of the `primitive_topic` lint
jubnzv 173d9ae
chore(all): Run clippy
jubnzv 4068abc
fix(fmt)
jubnzv 72bb431
fix(primitive_topic): Lint suppressions
jubnzv aa802c3
chore: cleanup
jubnzv 6157877
chore: make warning messages more consistent
jubnzv 941125a
Merge remote-tracking branch 'origin/master' into 1436-primitive-topic
jubnzv f10985b
feat(lint): support events 2.0
jubnzv a89088b
chore(all): Fix comments; remove needless empty file
jubnzv 3f99ce9
chore(all): Update `clippy_utils` version
jubnzv f66bd95
fix Cargo.toml
jubnzv fe26eaf
Merge remote-tracking branch 'origin/master' into 1436-primitive-topic
jubnzv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(lint): support events 2.0
Rework the lint after #1827
- Loading branch information
commit f10985bd17393a43f48468be305fd9801a1e1696
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,28 +1,28 @@ | ||
| error: using `#[ink(topic)]` for a field with a primitive number type | ||
| --> $DIR/primitive_topic.rs:20:9 | ||
| --> $DIR/primitive_topic.rs:11:9 | ||
| | | ||
| LL | value_4: crate::TyAlias2, | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `#[ink(topic)]`: `value_4: crate::TyAlias2` | ||
| LL | value_1: u8, | ||
| | ^^^^^^^^^^^ help: consider removing `#[ink(topic)]`: `value_1: u8` | ||
| | | ||
| = note: `-D primitive-topic` implied by `-D warnings` | ||
|
|
||
| error: using `#[ink(topic)]` for a field with a primitive number type | ||
| --> $DIR/primitive_topic.rs:17:9 | ||
| | | ||
| LL | value_3: crate::TyAlias1, | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `#[ink(topic)]`: `value_3: crate::TyAlias1` | ||
|
|
||
| error: using `#[ink(topic)]` for a field with a primitive number type | ||
| --> $DIR/primitive_topic.rs:14:9 | ||
| | | ||
| LL | value_2: Balance, | ||
| | ^^^^^^^^^^^^^^^^ help: consider removing `#[ink(topic)]`: `value_2: Balance` | ||
|
|
||
| error: using `#[ink(topic)]` for a field with a primitive number type | ||
| --> $DIR/primitive_topic.rs:11:9 | ||
| --> $DIR/primitive_topic.rs:17:9 | ||
| | | ||
| LL | value_1: u8, | ||
| | ^^^^^^^^^^^ help: consider removing `#[ink(topic)]`: `value_1: u8` | ||
| LL | value_3: crate::TyAlias1, | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `#[ink(topic)]`: `value_3: crate::TyAlias1` | ||
|
|
||
| error: using `#[ink(topic)]` for a field with a primitive number type | ||
| --> $DIR/primitive_topic.rs:20:9 | ||
| | | ||
| LL | value_4: crate::TyAlias2, | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `#[ink(topic)]`: `value_4: crate::TyAlias2` | ||
|
|
||
| error: aborting due to 4 previous errors | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.