feat: setup Danger (#1289)
Add Danger to automate code reviews. Currently, it only checks for a description in PRs and if the changelog file has been updated.
This commit is contained in:
parent
fe069650d6
commit
70fde932c0
9 changed files with 566 additions and 37 deletions
|
@ -38,6 +38,7 @@ script:
|
|||
else
|
||||
yarn build
|
||||
fi
|
||||
- yarn danger ci
|
||||
branches:
|
||||
except:
|
||||
- "/^v\\d+\\.\\d+\\.\\d+$/"
|
||||
|
|
|
@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|||
* Show exact wallet balance on mouse hover over ([#1305](https://github.com/lbryio/lbry-app/pull/1305))
|
||||
* New dark mode ([#1269](https://github.com/lbryio/lbry-app/pull/1269))
|
||||
* Pre-fill publish URL after clicking "Put something here" link ([#1303](https://github.com/lbryio/lbry-app/pull/1303))
|
||||
* Add Danger JS to automate code reviews ([#1289](https://github.com/lbryio/lbry-app/pull/1289))
|
||||
|
||||
### Changed
|
||||
* Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313))
|
||||
|
|
17
dangerfile.js
Normal file
17
dangerfile.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import { danger, warn } from 'danger';
|
||||
|
||||
// No PR is too small to include a description of why you made a change
|
||||
if (!danger.github.pr.body || danger.github.pr.body.length < 10) {
|
||||
const title = ':grey_question: No Description';
|
||||
const idea = 'Please include a description of your PR changes.';
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
}
|
||||
|
||||
// Check for a CHANGELOG entry
|
||||
const hasChangelog = danger.git.modified_files.some(f => f === 'CHANGELOG.md');
|
||||
if (!hasChangelog) {
|
||||
const title = ':page_facing_up: Changelog Entry Missing';
|
||||
const idea = 'Please add a changelog entry for your changes.';
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
}
|
|
@ -86,6 +86,9 @@
|
|||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"babel-preset-stage-2": "^6.18.0",
|
||||
"danger": "^3.6.0",
|
||||
"danger-plugin-eslint": "^0.1.0",
|
||||
"danger-plugin-yarn": "^1.3.0",
|
||||
"decompress": "^4.2.0",
|
||||
"del": "^3.0.0",
|
||||
"devtron": "^1.4.0",
|
||||
|
|
|
@ -45,7 +45,7 @@ export default class Address extends React.PureComponent<Props> {
|
|||
clipboard.writeText(address);
|
||||
doNotify({
|
||||
message: __('Address copied'),
|
||||
displayType: ['snackbar']
|
||||
displayType: ['snackbar'],
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
|
|
@ -20,7 +20,10 @@ type Props = {
|
|||
|
||||
class ShapeShift extends React.PureComponent<Props> {
|
||||
componentDidMount() {
|
||||
const { shapeShiftInit, shapeShift: { hasActiveShift, shiftSupportedCoins } } = this.props;
|
||||
const {
|
||||
shapeShiftInit,
|
||||
shapeShift: { hasActiveShift, shiftSupportedCoins },
|
||||
} = this.props;
|
||||
|
||||
if (!hasActiveShift && !shiftSupportedCoins.length) {
|
||||
// calls shapeshift to see list of supported coins for shifting
|
||||
|
|
|
@ -48,7 +48,13 @@ class ModalRemoveFile extends React.PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { claimIsMine, closeModal, deleteFile, fileInfo: { outpoint }, title } = this.props;
|
||||
const {
|
||||
claimIsMine,
|
||||
closeModal,
|
||||
deleteFile,
|
||||
fileInfo: { outpoint },
|
||||
title,
|
||||
} = this.props;
|
||||
const { deleteChecked, abandonClaimChecked } = this.state;
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue