danger-plugin-flow icon indicating copy to clipboard operation
danger-plugin-flow copied to clipboard

Respect max_header_tokens option

Open mxstbr opened this issue 6 years ago • 7 comments

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)

mxstbr avatar Mar 19 '18 16:03 mxstbr

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:

kevinSuttle avatar Mar 20 '18 02:03 kevinSuttle

https://repl.it/@kevinSuttle/Parsing-flowconfig-to-find-maxheadertokens

kevinSuttle avatar Mar 20 '18 03:03 kevinSuttle

PR please? :angel:

mxstbr avatar Mar 20 '18 07:03 mxstbr

Do you have suggestions for local testing?

kevinSuttle avatar Mar 22 '18 15:03 kevinSuttle

Mocking the Danger method, see the existing tests: https://github.com/withspectrum/danger-plugin-flow/blob/master/src/index.test.ts

mxstbr avatar Mar 22 '18 15:03 mxstbr

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?

kevinSuttle avatar Mar 28 '18 03:03 kevinSuttle

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.

mxstbr avatar Mar 28 '18 07:03 mxstbr