Instagram / IGListKit

A data-driven UICollectionView framework for building fast and flexible lists.
https://instagram.github.io/IGListKit/
MIT License
12.88k stars 1.54k forks source link

Automate PR checking with Danger #394

Open rnystrom opened 7 years ago

rnystrom commented 7 years ago

http://danger.systems/ cc @orta

Warnings

Failures

Any other ideas?

Sherlouk commented 7 years ago

Failure on changes to Pod files (.lock, .xcconfig) Source https://github.com/Instagram/IGListKit/pull/368#issuecomment-269092317

In the past I know Jesse has done some WIP pull requests, maybe a warning/failure if the PR title has [WIP] in it?

Also have you considered getting some sort of code linting in place? Would be good to have that in place to capture some nits/good structure (and add a failure for that)

Could we maybe get rid of my super janky markdown link checker from Travis and use prose instead? (Will cover things like spelling, links, etc in all our guides/markdown files)

jessesquires commented 7 years ago

Danger plugins:

Sherlouk commented 7 years ago

Could probably also do with a changelog format validator. {summary} {Name} (#{PR Number})

Should be easy to at least validate the correct PR and PR link

orta commented 7 years ago

There's a semi-standard for CHANGELOGs too - this plugin implements it - http://danger.systems/plugins/changelog.html

looks like https://github.com/ruby-grape/grape/blob/master/CHANGELOG.md

Sherlouk commented 7 years ago

As discussed in #399, we should always fail with a message similar to "Merging should be done internally" to prevent the merge button from ever being usable.

@rnystrom Should I go ahead and update the original comment with the various rules (as discussed above in thread) so we can tick them off once done?

rnystrom commented 7 years ago

@Sherlouk go for it!

Some linter ideas:

Sherlouk commented 7 years ago

@rnystrom Assume you meant classes not marked final for Swift?

Sherlouk commented 7 years ago

@rnystrom Worth keeping this issue open as there are still unimplemented rules?

rnystrom commented 7 years ago

@Sherlouk good call!

jessesquires commented 7 years ago

updated original issue to use markdown checklists 😄

Iron-Ham commented 7 years ago

@jessesquires taking this on re: SwiftLint. I'm assuming y'all also want the script running in the example build phases? I have a swiftlint.yml that I pop into all of my projects -- should i start there, or with the default ruleset: https://gist.github.com/heshamsalman/0910500186d4372f0c0d52ac73ea2110

jessesquires commented 7 years ago

thanks @heshamsalman !

let's start with the default rules 😄

Iron-Ham commented 7 years ago

Heads up, there's gonna be a clean-up task immediately after this for the examples. Staring down the barrel of 228 warnings with default rules.

jessesquires commented 7 years ago

@heshamsalman - No worries. Let's do it in 1 PR with individual commits for each step so we can review it easier. 1 commit for swiftLint, 1 commit to fixup each example

rnystrom commented 7 years ago

@jessesquires @heshamsalman is there an "ObjC lint"? This is so cool.

Iron-Ham commented 7 years ago

@rnystrom there are a few different objective c linters around -- I know of OCLint but haven't used it.

I'll look into it and report back

orta commented 7 years ago

Not strictly a linter, but we use Space commander by square for the syntax parts of it

Sherlouk commented 7 years ago

Do we know if there's a way to have Travis and Danger as separate integrations on GitHub?

Would be nice to know if a build failed because of tests/etc vs Danger without having to go through the build log!

orta commented 7 years ago

Get Danger to print your test results?

orta commented 7 years ago

Or use Circle CI for Danger

Iron-Ham commented 7 years ago

OCLint seems pretty similar to Swiftlint. Not quite as user friendly, but great overall.

Sherlouk commented 7 years ago

So it turns out prose is a lot more annoying to do than I was first hoping...

Not only do you danger-prose, but you also need proselint and mdspell. To get proselint you also need pip.

Lots of dependencies which we know Travis doesn't really like (and would add quite a lot of time to builds until caching is fully implemented #757)

Iron-Ham commented 7 years ago

Something tells me pip dependencies lead to a six error on travis.

On May 24, 2017, 5:42 PM -0400, James Sherlock notifications@github.com, wrote:

So it turns out prose is a lot more annoying to do than I was first hoping...

Not only do you danger-prose, but you also need proselint and mdspell. To get proselint you also need pip.

Lots of dependencies which we know Travis doesn't really like (and would add quite a lot of time to builds until caching is fully implemented #757 (https://github.com/Instagram/IGListKit/issues/757))

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/Instagram/IGListKit/issues/394#issuecomment-303860059), or mute the thread (https://github.com/notifications/unsubscribe-auth/ADOz3dxLpNB4e6oMqbdGuq00K1QznRn8ks5r9KQ6gaJpZM4Ldeac).

orta commented 7 years ago

Yeah - there wasn't anything like proselint or mdspell in ruby, shame :)