Skip to content

Commit

Permalink
feat(v1.3.1): release v1.3.1
Browse files Browse the repository at this point in the history
fixes testing issues, adds codecov
  • Loading branch information
sam committed Apr 1, 2021
1 parent 3246b90 commit d90acd7
Show file tree
Hide file tree
Showing 13 changed files with 168 additions and 75 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# GitHub Nodejs CI
name: nodejs

on: ["push"]
on: ['push']

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ["14.x"]
node-version: ['14.x']

steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 6 additions & 6 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
* @schema http://json.schemastore.org/prettierrc
*/

"use strict";
'use strict';

module.exports = {
arrowParens: "always",
arrowParens: 'always',
bracketSpacing: true,
endOfLine: "lf",
endOfLine: 'lf',
jsxBracketSameLine: false,
jsxSingleQuote: false,
printWidth: 100,
proseWrap: "always",
quoteProps: "as-needed",
proseWrap: 'always',
quoteProps: 'as-needed',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: "all",
trailingComma: 'all',
useTabs: false,
};
76 changes: 50 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,58 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

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

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

> 11 March 2021
- feat(jest): upgrade jest testing and linting [`bb9e206`](https://github.com/sambacha/prettier-config-solidity/commit/bb9e206a65c48aa6a570683a0cd03aed44b1ab72)
- SPDX: Apache-2.0 [`a04e9f3`](https://github.com/sambacha/prettier-config-solidity/commit/a04e9f3a674d4d60410fec5f59e6ad5207704659)
- tests(jest): helper file [`b2f352e`](https://github.com/sambacha/prettier-config-solidity/commit/b2f352e5033fa0d576bf0692482ba848cbff8339)
- feat(jest): upgrade jest testing and linting
[`bb9e206`](https://github.com/sambacha/prettier-config-solidity/commit/bb9e206a65c48aa6a570683a0cd03aed44b1ab72)
- SPDX: Apache-2.0
[`a04e9f3`](https://github.com/sambacha/prettier-config-solidity/commit/a04e9f3a674d4d60410fec5f59e6ad5207704659)
- tests(jest): helper file
[`b2f352e`](https://github.com/sambacha/prettier-config-solidity/commit/b2f352e5033fa0d576bf0692482ba848cbff8339)

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

> 9 March 2021
- v1.0.7 [`#12`](https://github.com/sambacha/prettier-config-solidity/pull/12)
- feat(release): v1.1.0 [`37aee99`](https://github.com/sambacha/prettier-config-solidity/commit/37aee993329e67aa39d80eee11b16dbdd89631e3)
- fix: npm [`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
- docs(readme): re-arrange sections [`872f262`](https://github.com/sambacha/prettier-config-solidity/commit/872f2624567ed633f060f3d8ee1a6d8c57a7bd46)
- feat(release): v1.1.0
[`37aee99`](https://github.com/sambacha/prettier-config-solidity/commit/37aee993329e67aa39d80eee11b16dbdd89631e3)
- fix: npm
[`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
- docs(readme): re-arrange sections
[`872f262`](https://github.com/sambacha/prettier-config-solidity/commit/872f2624567ed633f060f3d8ee1a6d8c57a7bd46)

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

> 2 March 2021
- semantic verisoning [`#10`](https://github.com/sambacha/prettier-config-solidity/pull/10)
- docs(readme): v1.0.3 [`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)
- feat(cfg): improve base config [`9b0cd7c`](https://github.com/sambacha/prettier-config-solidity/commit/9b0cd7c2db67efb8edf8d976eb8c4928ce7275cb)
- ci(nodejs): run test and semantic release [`e25756e`](https://github.com/sambacha/prettier-config-solidity/commit/e25756ea45e8fed66a0859f733b539c314dbd1d5)
- docs(readme): v1.0.3
[`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)
- feat(cfg): improve base config
[`9b0cd7c`](https://github.com/sambacha/prettier-config-solidity/commit/9b0cd7c2db67efb8edf8d976eb8c4928ce7275cb)
- ci(nodejs): run test and semantic release
[`e25756e`](https://github.com/sambacha/prettier-config-solidity/commit/e25756ea45e8fed66a0859f733b539c314dbd1d5)

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

> 20 February 2021
- chore(lts): update prettier-solidity-plugin and jest [`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
- chore(deps): update dependency prettier-plugin-solidity to v1.0.0-beta.5 [`a4e3e70`](https://github.com/sambacha/prettier-config-solidity/commit/a4e3e7060ed59a3cfdce40ba950f13c74de0eff7)
- docs(readme): quickstart [`e3cacfb`](https://github.com/sambacha/prettier-config-solidity/commit/e3cacfb8888a7ea2331feb7bc1bf237f4a50b855)
- chore(lts): update prettier-solidity-plugin and jest
[`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
- chore(deps): update dependency prettier-plugin-solidity to v1.0.0-beta.5
[`a4e3e70`](https://github.com/sambacha/prettier-config-solidity/commit/a4e3e7060ed59a3cfdce40ba950f13c74de0eff7)
- docs(readme): quickstart
[`e3cacfb`](https://github.com/sambacha/prettier-config-solidity/commit/e3cacfb8888a7ea2331feb7bc1bf237f4a50b855)

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

Expand All @@ -57,18 +72,24 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- v1.0.7 [`#12`](https://github.com/sambacha/prettier-config-solidity/pull/12)
- semantic verisoning [`#10`](https://github.com/sambacha/prettier-config-solidity/pull/10)
- Configure Renovate [`#2`](https://github.com/sambacha/prettier-config-solidity/pull/2)
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
- chore(lts): update prettier-solidity-plugin and jest [`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
- fix: npm [`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
- fix(git): coverage [`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
- chore(lts): update prettier-solidity-plugin and jest
[`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
- fix: npm
[`a2b40e5`](https://github.com/sambacha/prettier-config-solidity/commit/a2b40e51e99a018273dee01816781c0aa5e7de3a)
- fix(git): coverage
[`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)

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

> 12 January 2021
- feat(1.0.0): release 1.0.0 [`e5da423`](https://github.com/sambacha/prettier-config-solidity/commit/e5da423e6007ea317aba167a3cfacca4608257b7)
- release: 1..0.0 [`cc5bde3`](https://github.com/sambacha/prettier-config-solidity/commit/cc5bde36c3faa291a60d16ee79540b137188031e)
- Release 1.0.1 [`e429ed1`](https://github.com/sambacha/prettier-config-solidity/commit/e429ed1d415243f4786ce09fa22c103ab5dc0096)
- feat(1.0.0): release 1.0.0
[`e5da423`](https://github.com/sambacha/prettier-config-solidity/commit/e5da423e6007ea317aba167a3cfacca4608257b7)
- release: 1..0.0
[`cc5bde3`](https://github.com/sambacha/prettier-config-solidity/commit/cc5bde36c3faa291a60d16ee79540b137188031e)
- Release 1.0.1
[`e429ed1`](https://github.com/sambacha/prettier-config-solidity/commit/e429ed1d415243f4786ce09fa22c103ab5dc0096)

#### v1.0.0

Expand All @@ -77,7 +98,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- v1.0.7 [`#12`](https://github.com/sambacha/prettier-config-solidity/pull/12)
- semantic verisoning [`#10`](https://github.com/sambacha/prettier-config-solidity/pull/10)
- Configure Renovate [`#2`](https://github.com/sambacha/prettier-config-solidity/pull/2)
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
- chore(lts): update prettier-solidity-plugin and jest [`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
- fix(git): coverage [`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)
- docs(readme): v1.0.3 [`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)
- 1..0.0 [`#1`](https://github.com/sambacha/prettier-config-solidity/pull/1)
- chore(lts): update prettier-solidity-plugin and jest
[`e531d92`](https://github.com/sambacha/prettier-config-solidity/commit/e531d926393055d6c1aaf0fcb1c90dff5ccc363a)
- fix(git): coverage
[`6251595`](https://github.com/sambacha/prettier-config-solidity/commit/6251595eee452dec9a612d92ae7027d783d159cf)
- docs(readme): v1.0.3
[`95799a8`](https://github.com/sambacha/prettier-config-solidity/commit/95799a816e29f8def2d6b121dfe3e68cda51b5f8)
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# [prettier-config-solidity](#)

[![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)
[![codecov](https://codecov.io/gh/sambacha/prettier-solidity-config/branch/master/graph/badge.svg?token=1k3OYjAl8C)](https://codecov.io/gh/sambacha/prettier-solidity-config)

> Prettier configuration for Solidity
## Quickstart
Expand All @@ -11,9 +14,9 @@
* @summary Prettier Configuration for Solidity
*/

"use strict";
'use strict';

const prettierConfig = require("prettier-config-solidity");
const prettierConfig = require('prettier-config-solidity');
module.exports = prettierConfig;
```

Expand Down Expand Up @@ -59,10 +62,10 @@ guide):

```jsx
// bad
const foo = { clark: "kent" };
const foo = { clark: 'kent' };

// good
const foo = { clark: "kent" };
const foo = { clark: 'kent' };
```

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

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

// bad
Expand Down Expand Up @@ -119,18 +122,18 @@ const foo = { clark: "kent" };
// bad
const items = getItems(),
goSportsTeam = true,
dragonball = "z";
dragonball = 'z';

// bad
// (compare to above, and try to spot the mistake)
const items = getItems(),
goSportsTeam = true;
dragonball = "z";
dragonball = 'z';

// good
const items = getItems();
const goSportsTeam = true;
const dragonball = "z";
const dragonball = 'z';
```

#### 20.2 Additional trailing comma: Yup. eslint: comma-dangle
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ codecov:
coverage:
precision: 2
round: down
range: "90...100"
range: '90...100'
37 changes: 37 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @file Prettier configuration for Solidity
* @version 1.1.0
* @summary base config adapted from AirBNB to reduce diff churn
* @overrides solidity settings from Solidity Documentation
* @note `printWidth` is not a line character capture
* @dev `explicitTypes`
*/

module.exports = {
arrowParens: 'always',
bracketSpacing: true,
jsxBracketSameLine: false,
jsxSingleQuote: false,
endOfLine: 'lf',
printWidth: 80,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
quoteProps: 'as-needed',
proseWrap: 'always',
semi: true,
overrides: [
{
files: '*.sol',
options: {
printWidth: 80,
tabWidth: 4,
useTabs: false,
singleQuote: false,
bracketSpacing: true,
explicitTypes: 'always',
},
},
],
};
/** @exports prettier-config-solidity */
2 changes: 1 addition & 1 deletion index.spec.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
run_spec("../tests/__snapshots__/jsfmt.spec.js.snap");
run_spec('../tests/__snapshots__/jsfmt.spec.js.snap');
27 changes: 12 additions & 15 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
"scripts/**/*.js",
"!scripts/generateIndexes.js",
"!scripts/makeData.js",
"src/**/*.js",
"!<rootDir>/node_modules/",
"!src/prettier-comments/**/*.js",
'scripts/**/*.js',
'!scripts/generateIndexes.js',
'!scripts/makeData.js',
'src/**/*.js',
'!<rootDir>/node_modules/',
'!src/prettier-comments/**/*.js',
],
coverageDirectory: "./coverage/",
coverageDirectory: './coverage/',
coverageThreshold: {
global: {
branches: 100,
Expand All @@ -19,13 +19,10 @@ module.exports = {
statements: 100,
},
},
setupFiles: ["<rootDir>/tests_config/run_spec.js"],
snapshotSerializers: ["<rootDir>/tests_config/raw-serializer.js"],
testEnvironment: "node",
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$|scripts/.*\\.test\\.js$",
setupFiles: ['<rootDir>/tests_config/run_spec.js'],
snapshotSerializers: ['<rootDir>/tests_config/raw-serializer.js'],
testEnvironment: 'node',
testRegex: 'jsfmt\\.spec\\.js$|__tests__/.*\\.js$|scripts/.*\\.test\\.js$',
transform: {},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};
7 changes: 2 additions & 5 deletions scripts/generateIndexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ const prettier = require('prettier');
const makeData = require('./makeData');

if (process.env.SCRIPT === 'true') {
prettier.resolveConfig(`${__dirname}../.prettierrc`).then((options) => {
prettier.resolveConfig(`${__dirname}../.prettierrc.js`).then((options) => {
// eslint-disable-next-line no-param-reassign
options.parser = 'babel';
['../src'].forEach((dir) => {
fs.writeFileSync(
`${__dirname}/${dir}/index.js`,
prettier.format(makeData(dir), options)
);
fs.writeFileSync(`${__dirname}/${dir}/config.js`, prettier.format(makeData(dir), options));
});
});
}
8 changes: 3 additions & 5 deletions scripts/makeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ const dirToObject = require('dir-to-object');

function makeData(dir) {
const nodes = Object.keys(
dirToObject(`${__dirname}/${dir}`, { canAdd: (data) => data.print })
dirToObject(`${__dirname}/${dir}`, { canAdd: (data) => data.print }),
).reduce((accumulator, current) => {
accumulator[current] = `require('./${current}.js')`;
return accumulator;
}, {});

const data = `/* This file was automatically generated on ${
Date.now() / 1000
} */
const data = `/* This file was automatically generated on ${Date.now() / 1000} */
/* eslint-disable global-require */
Expand All @@ -19,4 +17,4 @@ function makeData(dir) {
return data.replace(/["]+/g, '');
}

module.exports = makeData;
module.exports = makeData;
2 changes: 1 addition & 1 deletion scripts/makeData.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ const makeData = require('./makeData');

test('makeData to match snapshot', () => {
expect(makeData('../src')).toMatchSnapshot();
});
});
5 changes: 5 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* This file was automatically generated on 1617246797.785 */

/* eslint-disable global-require */

module.exports = {};
Loading

0 comments on commit d90acd7

Please sign in to comment.