Name: peril-settings
Owner: Artsy
Description: Artsy's peril settings
Created: 2016-09-12 17:43:30.0
Updated: 2018-05-22 13:49:11.0
Pushed: 2018-05-24 15:04:07.0
Size: 261
Language: TypeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is the configuration repo for Peril on the Artsy org. There is a settings file and org-wide dangerfiles which are inside the org folder.
Here's some links to the key things
Peril is Danger running on a web-server, this repo is the configuration for that, currently the dangerfiles in org run on every issue and pull request for all our repos.
clone https://github.com/artsy/artsy-danger.git
rtsy-danger
install
.
You will need node and yarn installed beforehand. You can get them both by running brew install yarn
. This will give
you auto-completion and types for Danger/Peril mainly.
It's likely that any time you want to make a change here you should consult the Artsy RFC process and apply it to this repo.
A rule should be wrapped in an rfc closure:
ttps://github.com/artsy/artsy-danger/issues/2
"Keep our Markdown documents awesome", () => {
[...]
This self-documents where a rule has come from, making it easy for others to understand how we came to specific rules.
The closure passed to rfc
can be async as well.
We use Jest to test our Dangerfiles. It uses the same techniques as testing a danger plugin where the global imports from danger are fake.
Create a file for your RFC: tests/rfc_[x].test.ts
.
Add a before
and after
setting up and resetting mocks:
.mock("danger", () => jest.fn())
rt * as danger from "danger"
t dm = danger as any
reEach(() => {
danger = {}
fail = jest.fn() // as necessary
rEach(() => {
fail = undefined
Set up your danger object and run the function exported in all-prs.ts
:
rt { rfcN } from "../org/all-prs"
warns when there's there's no assignee and no WIP in the title", () => {
danger.github = { pr: { title: "Changes to the setup script", assignee: null } }
urn rfcN().then(() => {
/ [...]
Validate that the fail
/warn
/message
/markdown
is called.