Skip to content

Commit

Permalink
add: explanation to script
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed Feb 28, 2024
1 parent cd0cd04 commit 9e2a071
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/rules/best-practises/explicit-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,16 @@ class ExplicitTypesChecker extends BaseChecker {
fixStatement(node, errorVar) {
const range = this.findTypeRanges(node, errorVar)

// previous script searches all json and if two unit are in the same line
// previous script searches all json and if two uint/uint256/ufixed/etc are in the same line
// it will return two set of range values
// this is to remove the first one if it's already been corrected
// and to push it to the array to store the corrected ones

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Run linter and tests on Windows

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Run linter and tests on Linux (16)

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Test on MacOS

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Run linter and tests on MacOS

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Run linter and tests on Linux (18)

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Test on Windows

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Test on Linux with Node 16

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Run linter and tests on Linux (20)

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Test on Linux with Node 18

Delete `·`

Check failure on line 188 in lib/rules/best-practises/explicit-types.js

View workflow job for this annotation

GitHub Actions / Test on Linux with Node 20

Delete `·`
if (alreadyFixedRanges.includes(range[0])) {
range.shift()
}
alreadyFixedRanges.push(range[0])

// only check the first range returned when findTypesRanges return two or more
const charsToReplace = errorVar.length - 1
range[0][1] = range[0][0] + charsToReplace

Expand Down

0 comments on commit 9e2a071

Please sign in to comment.