Skip to content

Commit 29c48d9

Browse files
committed
Fix lint and enable formatting after generation
1 parent 80edba8 commit 29c48d9

File tree

5 files changed

+8
-20
lines changed

5 files changed

+8
-20
lines changed

contracts/utils/structs/EnumerableMapExtended.sol

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ library EnumerableMapExtended {
120120
*
121121
* - `index` must be strictly less than {length}.
122122
*/
123-
function at(
124-
BytesToUintMap storage map,
125-
uint256 index
126-
) internal view returns (bytes memory key, uint256 value) {
123+
function at(BytesToUintMap storage map, uint256 index) internal view returns (bytes memory key, uint256 value) {
127124
key = map._keys.at(index);
128125
value = map._values[key];
129126
}
@@ -132,10 +129,7 @@ library EnumerableMapExtended {
132129
* @dev Tries to returns the value associated with `key`. O(1).
133130
* Does not revert if `key` is not in the map.
134131
*/
135-
function tryGet(
136-
BytesToUintMap storage map,
137-
bytes memory key
138-
) internal view returns (bool exists, uint256 value) {
132+
function tryGet(BytesToUintMap storage map, bytes memory key) internal view returns (bool exists, uint256 value) {
139133
value = map._values[key];
140134
exists = value != uint256(0) || contains(map, key);
141135
}

contracts/utils/structs/EnumerableSetExtended.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {Hashes} from "../cryptography/Hashes.sol";
2727
* }
2828
* ```
2929
*
30-
* Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and
30+
* Sets of type `string` (`StringSet`), `bytes` (`BytesSet`) and
3131
* `bytes32[2]` (`Bytes32x2Set`) are supported.
3232
*
3333
* [WARNING]

scripts/generate/run.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
// const cp = require('child_process');
3+
const cp = require('child_process');
44
const fs = require('fs');
55
const path = require('path');
66
const format = require('./format-lines');
@@ -27,7 +27,7 @@ function generateFromTemplate(file, template, outputPrefix = '') {
2727
);
2828

2929
fs.writeFileSync(output, content);
30-
// cp.execFileSync('prettier', ['--write', output]);
30+
cp.execFileSync('prettier', ['--write', output]);
3131
}
3232

3333
// Contracts

scripts/generate/templates/EnumerableMapExtended.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ function length(${name} storage map) internal view returns (uint256) {
120120
*
121121
* - \`index\` must be strictly less than {length}.
122122
*/
123-
function at(
124-
${name} storage map,
125-
uint256 index
126-
) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) {
123+
function at(${name} storage map, uint256 index) internal view returns (${key.typeLoc} key, ${value.typeLoc} value) {
127124
key = map._keys.at(index);
128125
value = map._values[key];
129126
}
@@ -132,10 +129,7 @@ function at(
132129
* @dev Tries to returns the value associated with \`key\`. O(1).
133130
* Does not revert if \`key\` is not in the map.
134131
*/
135-
function tryGet(
136-
${name} storage map,
137-
${key.typeLoc} key
138-
) internal view returns (bool exists, ${value.typeLoc} value) {
132+
function tryGet(${name} storage map, ${key.typeLoc} key) internal view returns (bool exists, ${value.typeLoc} value) {
139133
value = map._values[key];
140134
exists = ${value.memory ? 'bytes(value).length != 0' : `value != ${value.type}(0)`} || contains(map, key);
141135
}

scripts/generate/templates/EnumerableSetExtended.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {Hashes} from "../cryptography/Hashes.sol";
2828
* }
2929
* \`\`\`
3030
*
31-
* Sets of type \`string\` (\`StringSet\`), \`bytes\` (\`BytesSet\`) and
31+
* Sets of type \`string\` (\`StringSet\`), \`bytes\` (\`BytesSet\`) and
3232
* \`bytes32[2]\` (\`Bytes32x2Set\`) are supported.
3333
*
3434
* [WARNING]

0 commit comments

Comments
 (0)