danger-plugin-flow
danger-plugin-flow copied to clipboard
Respect max_header_tokens option
Ref #4, thanks to @iamdustan who correctly pointed out that we should respect the max_header_tokens
options of the .flowconfig
.
Something like
const flowconfig = await danger.github.utils.fileContents('.flowconfig')
// TODO: Figure out how to parse .flowconfig somehow (why isn't it JSON ugh)
We are not proud of our custom format and plan to support a better format in the future. GitHub issue #153 tracks this.
– https://flow.org/en/docs/config/
https://github.com/facebook/flow/issues/153 :hurtrealbad:
https://repl.it/@kevinSuttle/Parsing-flowconfig-to-find-maxheadertokens
PR please? :angel:
Do you have suggestions for local testing?
Mocking the Danger method, see the existing tests: https://github.com/withspectrum/danger-plugin-flow/blob/master/src/index.test.ts
Yep, saw those. I haven't tested a Danger plugin before—in other words, how do I test it against a set of files as if it's a PR? Is that possible?
We don't have that kind of fancy mocking in place, I'd just check whether the requested filename is .flowconfig
and return the contents of that.