Skip to content

Commit d90acd7

Browse files
author
sam
committed
feat(v1.3.1): release v1.3.1
fixes testing issues, adds codecov
1 parent 3246b90 commit d90acd7

13 files changed

Lines changed: 168 additions & 75 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# GitHub Nodejs CI
22
name: nodejs
33

4-
on: ["push"]
4+
on: ['push']
55

66
jobs:
77
build:
88
runs-on: ubuntu-latest
99

1010
strategy:
1111
matrix:
12-
node-version: ["14.x"]
12+
node-version: ['14.x']
1313

1414
steps:
1515
- uses: actions/checkout@v2

.prettierrc.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
* @schema http://json.schemastore.org/prettierrc
66
*/
77

8-
"use strict";
8+
'use strict';
99

1010
module.exports = {
11-
arrowParens: "always",
11+
arrowParens: 'always',
1212
bracketSpacing: true,
13-
endOfLine: "lf",
13+
endOfLine: 'lf',
1414
jsxBracketSameLine: false,
1515
jsxSingleQuote: false,
1616
printWidth: 100,
17-
proseWrap: "always",
18-
quoteProps: "as-needed",
17+
proseWrap: 'always',
18+
quoteProps: 'as-needed',
1919
semi: true,
2020
singleQuote: true,
2121
tabWidth: 2,
22-
trailingComma: "all",
22+
trailingComma: 'all',
2323
useTabs: false,
2424
};

CHANGELOG.md

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,58 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
88

99
> 11 March 2021
1010
11-
- test(jest): generate snapshot fixes [`f2fb279`](https://github.com/sambacha/prettier-config-solidity/commit/f2fb279dc9d26a57bd75911d20fb7f99987d3aea)
12-
- test(jest): generate [`dbbe764`](https://github.com/sambacha/prettier-config-solidity/commit/dbbe7644b5591cd0b2d712ee0459674d1d23ce48)
13-
- fix(solidity): ensure conformance on test files [`f47b8a3`](https://github.com/sambacha/prettier-config-solidity/commit/f47b8a3b648d769c741556087e0d635d40d0c62b)
11+
- test(jest): generate snapshot fixes
12+
[`f2fb279`](https://github.com/sambacha/prettier-config-solidity/commit/f2fb279dc9d26a57bd75911d20fb7f99987d3aea)
13+
- test(jest): generate
14+
[`dbbe764`](https://github.com/sambacha/prettier-config-solidity/commit/dbbe7644b5591cd0b2d712ee0459674d1d23ce48)
15+
- fix(solidity): ensure conformance on test files
16+
[`f47b8a3`](https://github.com/sambacha/prettier-config-solidity/commit/f47b8a3b648d769c741556087e0d635d40d0c62b)
1417

1518
#### [v1.2.0](https://github.com/sambacha/prettier-config-solidity/compare/v1.1.0...v1.2.0)
1619

1720
> 11 March 2021
1821
19-
- feat(jest): upgrade jest testing and linting [`bb9e206`](https://github.com/sambacha/prettier-config-solidity/commit/bb9e206a65c48aa6a570683a0cd03aed44b1ab72)
20-
- SPDX: Apache-2.0 [`a04e9f3`](https://github.com/sambacha/prettier-config-solidity/commit/a04e9f3a674d4d60410fec5f59e6ad5207704659)
21-
- tests(jest): helper file [`b2f352e`](https://github.com/sambacha/prettier-config-solidity/commit/b2f352e5033fa0d576bf0692482ba848cbff8339)
22+
- feat(jest): upgrade jest testing and linting
23+
[`bb9e206`](https://github.com/sambacha/prettier-config-solidity/commit/bb9e206a65c48aa6a570683a0cd03aed44b1ab72)
24+
- SPDX: Apache-2.0
25+
[`a04e9f3`](https://github.com/sambacha/prettier-config-solidity/commit/a04e9f3a674d4d60410fec5f59e6ad5207704659)
26+
- tests(jest): helper file
27+
[`b2f352e`](https://github.com/sambacha/prettier-config-solidity/commit/b2f352e5033fa0d576bf0692482ba848cbff8339)
2228

2329
#### [v1.1.0](https://github.com/sambacha/prettier-config-solidity/compare/1.0.4...v1.1.0)
2430

2531
> 9 March 2021
2632
2733
- v1.0.7 [`#12`](https://github.com/sambacha/prettier-config-solidity/pull/12)
28-
- feat(release): v1.1.0 [`37aee99`](https://github.com/sambacha/prettier-config-solidity/commit/37aee993329e67aa39d80eee11b16dbdd89631e3)
29-
- fix: npm [`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
30-
- docs(readme): re-arrange sections [`872f262`](https://github.com/sambacha/prettier-config-solidity/commit/872f2624567ed633f060f3d8ee1a6d8c57a7bd46)
34+
- feat(release): v1.1.0
35+
[`37aee99`](https://github.com/sambacha/prettier-config-solidity/commit/37aee993329e67aa39d80eee11b16dbdd89631e3)
36+
- fix: npm
37+
[`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
38+
- docs(readme): re-arrange sections
39+
[`872f262`](https://github.com/sambacha/prettier-config-solidity/commit/872f2624567ed633f060f3d8ee1a6d8c57a7bd46)
3140

3241
#### [1.0.4](https://github.com/sambacha/prettier-config-solidity/compare/1.0.3...1.0.4)
3342

3443
> 2 March 2021
3544
3645
- semantic verisoning [`#10`](https://github.com/sambacha/prettier-config-solidity/pull/10)
37-
- docs(readme): v1.0.3 [`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)
38-
- feat(cfg): improve base config [`9b0cd7c`](https://github.com/sambacha/prettier-config-solidity/commit/9b0cd7c2db67efb8edf8d976eb8c4928ce7275cb)
39-
- ci(nodejs): run test and semantic release [`e25756e`](https://github.com/sambacha/prettier-config-solidity/commit/e25756ea45e8fed66a0859f733b539c314dbd1d5)
46+
- docs(readme): v1.0.3
47+
[`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)
48+
- feat(cfg): improve base config
49+
[`9b0cd7c`](https://github.com/sambacha/prettier-config-solidity/commit/9b0cd7c2db67efb8edf8d976eb8c4928ce7275cb)
50+
- ci(nodejs): run test and semantic release
51+
[`e25756e`](https://github.com/sambacha/prettier-config-solidity/commit/e25756ea45e8fed66a0859f733b539c314dbd1d5)
4052

4153
#### [1.0.3](https://github.com/sambacha/prettier-config-solidity/compare/1.0.2...1.0.3)
4254

4355
> 20 February 2021
4456
45-
- chore(lts): update prettier-solidity-plugin and jest [`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
46-
- chore(deps): update dependency prettier-plugin-solidity to v1.0.0-beta.5 [`a4e3e70`](https://github.com/sambacha/prettier-config-solidity/commit/a4e3e7060ed59a3cfdce40ba950f13c74de0eff7)
47-
- docs(readme): quickstart [`e3cacfb`](https://github.com/sambacha/prettier-config-solidity/commit/e3cacfb8888a7ea2331feb7bc1bf237f4a50b855)
57+
- chore(lts): update prettier-solidity-plugin and jest
58+
[`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
59+
- chore(deps): update dependency prettier-plugin-solidity to v1.0.0-beta.5
60+
[`a4e3e70`](https://github.com/sambacha/prettier-config-solidity/commit/a4e3e7060ed59a3cfdce40ba950f13c74de0eff7)
61+
- docs(readme): quickstart
62+
[`e3cacfb`](https://github.com/sambacha/prettier-config-solidity/commit/e3cacfb8888a7ea2331feb7bc1bf237f4a50b855)
4863

4964
#### [1.0.2](https://github.com/sambacha/prettier-config-solidity/compare/v1.0.1...1.0.2)
5065

@@ -57,18 +72,24 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
5772
- v1.0.7 [`#12`](https://github.com/sambacha/prettier-config-solidity/pull/12)
5873
- semantic verisoning [`#10`](https://github.com/sambacha/prettier-config-solidity/pull/10)
5974
- Configure Renovate [`#2`](https://github.com/sambacha/prettier-config-solidity/pull/2)
60-
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
61-
- chore(lts): update prettier-solidity-plugin and jest [`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
62-
- fix: npm [`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
63-
- fix(git): coverage [`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)
75+
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
76+
- chore(lts): update prettier-solidity-plugin and jest
77+
[`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
78+
- fix: npm
79+
[`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
80+
- fix(git): coverage
81+
[`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)
6482

6583
#### [1.0.1](https://github.com/sambacha/prettier-config-solidity/compare/v1.0.0...1.0.1)
6684

6785
> 12 January 2021
6886
69-
- feat(1.0.0): release 1.0.0 [`e5da423`](https://github.com/sambacha/prettier-config-solidity/commit/e5da423e6007ea317aba167a3cfacca4608257b7)
70-
- release: 1..0.0 [`cc5bde3`](https://github.com/sambacha/prettier-config-solidity/commit/cc5bde36c3faa291a60d16ee79540b137188031e)
71-
- Release 1.0.1 [`e429ed1`](https://github.com/sambacha/prettier-config-solidity/commit/e429ed1d415243f4786ce09fa22c103ab5dc0096)
87+
- feat(1.0.0): release 1.0.0
88+
[`e5da423`](https://github.com/sambacha/prettier-config-solidity/commit/e5da423e6007ea317aba167a3cfacca4608257b7)
89+
- release: 1..0.0
90+
[`cc5bde3`](https://github.com/sambacha/prettier-config-solidity/commit/cc5bde36c3faa291a60d16ee79540b137188031e)
91+
- Release 1.0.1
92+
[`e429ed1`](https://github.com/sambacha/prettier-config-solidity/commit/e429ed1d415243f4786ce09fa22c103ab5dc0096)
7293

7394
#### v1.0.0
7495

@@ -77,7 +98,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
7798
- v1.0.7 [`#12`](https://github.com/sambacha/prettier-config-solidity/pull/12)
7899
- semantic verisoning [`#10`](https://github.com/sambacha/prettier-config-solidity/pull/10)
79100
- Configure Renovate [`#2`](https://github.com/sambacha/prettier-config-solidity/pull/2)
80-
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
81-
- chore(lts): update prettier-solidity-plugin and jest [`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
82-
- fix(git): coverage [`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)
83-
- docs(readme): v1.0.3 [`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)
101+
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
102+
- chore(lts): update prettier-solidity-plugin and jest
103+
[`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
104+
- fix(git): coverage
105+
[`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)
106+
- docs(readme): v1.0.3
107+
[`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# [prettier-config-solidity](#)
22

3+
[![nodejs](https://github.com/sambacha/prettier-config-solidity/actions/workflows/nodejs.yml/badge.svg)](https://github.com/sambacha/prettier-config-solidity/actions/workflows/nodejs.yml)
4+
[![codecov](https://codecov.io/gh/sambacha/prettier-solidity-config/branch/master/graph/badge.svg?token=1k3OYjAl8C)](https://codecov.io/gh/sambacha/prettier-solidity-config)
5+
36
> Prettier configuration for Solidity
47
58
## Quickstart
@@ -11,9 +14,9 @@
1114
* @summary Prettier Configuration for Solidity
1215
*/
1316

14-
"use strict";
17+
'use strict';
1518

16-
const prettierConfig = require("prettier-config-solidity");
19+
const prettierConfig = require('prettier-config-solidity');
1720
module.exports = prettierConfig;
1821
```
1922

@@ -59,10 +62,10 @@ guide):
5962

6063
```jsx
6164
// bad
62-
const foo = { clark: "kent" };
65+
const foo = { clark: 'kent' };
6366

6467
// good
65-
const foo = { clark: "kent" };
68+
const foo = { clark: 'kent' };
6669
```
6770

6871
#### arrow-parens
@@ -83,13 +86,13 @@ const foo = { clark: "kent" };
8386
// bad
8487
[1, 2, 3].map(
8588
(number) =>
86-
`A long string with the ${number}. It’s so long that we don’t want it to take up space on the .map line!`
89+
`A long string with the ${number}. It’s so long that we don’t want it to take up space on the .map line!`,
8790
);
8891

8992
// good
9093
[1, 2, 3].map(
9194
(number) =>
92-
`A long string with the ${number}. It’s so long that we don’t want it to take up space on the .map line!`
95+
`A long string with the ${number}. It’s so long that we don’t want it to take up space on the .map line!`,
9396
);
9497

9598
// bad
@@ -119,18 +122,18 @@ const foo = { clark: "kent" };
119122
// bad
120123
const items = getItems(),
121124
goSportsTeam = true,
122-
dragonball = "z";
125+
dragonball = 'z';
123126

124127
// bad
125128
// (compare to above, and try to spot the mistake)
126129
const items = getItems(),
127130
goSportsTeam = true;
128-
dragonball = "z";
131+
dragonball = 'z';
129132

130133
// good
131134
const items = getItems();
132135
const goSportsTeam = true;
133-
const dragonball = "z";
136+
const dragonball = 'z';
134137
```
135138

136139
#### 20.2 Additional trailing comma: Yup. eslint: comma-dangle

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ codecov:
44
coverage:
55
precision: 2
66
round: down
7-
range: "90...100"
7+
range: '90...100'

index.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* @file Prettier configuration for Solidity
3+
* @version 1.1.0
4+
* @summary base config adapted from AirBNB to reduce diff churn
5+
* @overrides solidity settings from Solidity Documentation
6+
* @note `printWidth` is not a line character capture
7+
* @dev `explicitTypes`
8+
*/
9+
10+
module.exports = {
11+
arrowParens: 'always',
12+
bracketSpacing: true,
13+
jsxBracketSameLine: false,
14+
jsxSingleQuote: false,
15+
endOfLine: 'lf',
16+
printWidth: 80,
17+
singleQuote: true,
18+
tabWidth: 2,
19+
trailingComma: 'all',
20+
quoteProps: 'as-needed',
21+
proseWrap: 'always',
22+
semi: true,
23+
overrides: [
24+
{
25+
files: '*.sol',
26+
options: {
27+
printWidth: 80,
28+
tabWidth: 4,
29+
useTabs: false,
30+
singleQuote: false,
31+
bracketSpacing: true,
32+
explicitTypes: 'always',
33+
},
34+
},
35+
],
36+
};
37+
/** @exports prettier-config-solidity */

index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
run_spec("../tests/__snapshots__/jsfmt.spec.js.snap");
1+
run_spec('../tests/__snapshots__/jsfmt.spec.js.snap');

jest.config.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
module.exports = {
44
collectCoverage: true,
55
collectCoverageFrom: [
6-
"scripts/**/*.js",
7-
"!scripts/generateIndexes.js",
8-
"!scripts/makeData.js",
9-
"src/**/*.js",
10-
"!<rootDir>/node_modules/",
11-
"!src/prettier-comments/**/*.js",
6+
'scripts/**/*.js',
7+
'!scripts/generateIndexes.js',
8+
'!scripts/makeData.js',
9+
'src/**/*.js',
10+
'!<rootDir>/node_modules/',
11+
'!src/prettier-comments/**/*.js',
1212
],
13-
coverageDirectory: "./coverage/",
13+
coverageDirectory: './coverage/',
1414
coverageThreshold: {
1515
global: {
1616
branches: 100,
@@ -19,13 +19,10 @@ module.exports = {
1919
statements: 100,
2020
},
2121
},
22-
setupFiles: ["<rootDir>/tests_config/run_spec.js"],
23-
snapshotSerializers: ["<rootDir>/tests_config/raw-serializer.js"],
24-
testEnvironment: "node",
25-
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$|scripts/.*\\.test\\.js$",
22+
setupFiles: ['<rootDir>/tests_config/run_spec.js'],
23+
snapshotSerializers: ['<rootDir>/tests_config/raw-serializer.js'],
24+
testEnvironment: 'node',
25+
testRegex: 'jsfmt\\.spec\\.js$|__tests__/.*\\.js$|scripts/.*\\.test\\.js$',
2626
transform: {},
27-
watchPlugins: [
28-
"jest-watch-typeahead/filename",
29-
"jest-watch-typeahead/testname",
30-
],
27+
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
3128
};

scripts/generateIndexes.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ const prettier = require('prettier');
33
const makeData = require('./makeData');
44

55
if (process.env.SCRIPT === 'true') {
6-
prettier.resolveConfig(`${__dirname}../.prettierrc`).then((options) => {
6+
prettier.resolveConfig(`${__dirname}../.prettierrc.js`).then((options) => {
77
// eslint-disable-next-line no-param-reassign
88
options.parser = 'babel';
99
['../src'].forEach((dir) => {
10-
fs.writeFileSync(
11-
`${__dirname}/${dir}/index.js`,
12-
prettier.format(makeData(dir), options)
13-
);
10+
fs.writeFileSync(`${__dirname}/${dir}/config.js`, prettier.format(makeData(dir), options));
1411
});
1512
});
1613
}

scripts/makeData.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ const dirToObject = require('dir-to-object');
22

33
function makeData(dir) {
44
const nodes = Object.keys(
5-
dirToObject(`${__dirname}/${dir}`, { canAdd: (data) => data.print })
5+
dirToObject(`${__dirname}/${dir}`, { canAdd: (data) => data.print }),
66
).reduce((accumulator, current) => {
77
accumulator[current] = `require('./${current}.js')`;
88
return accumulator;
99
}, {});
1010

11-
const data = `/* This file was automatically generated on ${
12-
Date.now() / 1000
13-
} */
11+
const data = `/* This file was automatically generated on ${Date.now() / 1000} */
1412
1513
/* eslint-disable global-require */
1614
@@ -19,4 +17,4 @@ function makeData(dir) {
1917
return data.replace(/["]+/g, '');
2018
}
2119

22-
module.exports = makeData;
20+
module.exports = makeData;

0 commit comments

Comments
 (0)