Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Guide to StyleCI (Extended)

A Guide to StyleCI (Extended)

Presented at PHP Cambridge 2017. Distributed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Graham Campbell

September 19, 2017
Tweet

More Decks by Graham Campbell

Other Decks in Programming

Transcript

  1. Graham Campbell https://github.com/GrahamCampbell https://twitter.com/GrahamJCampbell https://gjcampbell.co.uk/ Who am I? Disclaimer: The

    views and opinions expressed are my own. StyleCI and Cachet are not associated with the University of York, Cambridge Consultants, or Bugsnag. StyleCI and Cachet are the intellectual property of Alt Three Services Limited.
  2. Who am I? Current: • Student at the University of

    York ◦ BSc Computer Science and Mathematics Graham Campbell https://github.com/GrahamCampbell https://twitter.com/GrahamJCampbell https://gjcampbell.co.uk/ Disclaimer: The views and opinions expressed are my own. StyleCI and Cachet are not associated with the University of York, Cambridge Consultants, or Bugsnag. StyleCI and Cachet are the intellectual property of Alt Three Services Limited.
  3. Current: • Student at the University of York ◦ BSc

    Computer Science and Mathematics • Placement at Cambridge Consultants ◦ Software Technologies, ICE Who am I? Graham Campbell https://github.com/GrahamCampbell https://twitter.com/GrahamJCampbell https://gjcampbell.co.uk/ Disclaimer: The views and opinions expressed are my own. StyleCI and Cachet are not associated with the University of York, Cambridge Consultants, or Bugsnag. StyleCI and Cachet are the intellectual property of Alt Three Services Limited.
  4. Current: • Student at the University of York ◦ BSc

    Computer Science and Mathematics • Placement at Cambridge Consultants ◦ Software Technologies, ICE • Laravel Framework Core Team ◦ Contributing since August 2013 Who am I? Graham Campbell https://github.com/GrahamCampbell https://twitter.com/GrahamJCampbell https://gjcampbell.co.uk/
  5. Current: • Student at the University of York ◦ BSc

    Computer Science and Mathematics • Placement at Cambridge Consultants ◦ Software Technologies, ICE • Laravel Framework Core Team ◦ Contributing since August 2013 • StyleCI Founder and Cachet Core Who am I? Graham Campbell https://github.com/GrahamCampbell https://twitter.com/GrahamJCampbell https://gjcampbell.co.uk/ Disclaimer: The views and opinions expressed are my own. StyleCI and Cachet are not associated with the University of York, Cambridge Consultants, or Bugsnag. StyleCI and Cachet are the intellectual property of Alt Three Services Limited.
  6. Current: • Student at the University of York ◦ BSc

    Computer Science and Mathematics • Placement at Cambridge Consultants ◦ Software Technologies, ICE • Laravel Framework Core Team ◦ Contributing since August 2013 • StyleCI Founder and Cachet Core Previous: • Bugsnag UK Office ◦ Primarily worked on their PHP notifiers Who am I? Graham Campbell https://github.com/GrahamCampbell https://twitter.com/GrahamJCampbell https://gjcampbell.co.uk/ Disclaimer: The views and opinions expressed are my own. StyleCI and Cachet are not associated with the University of York, Cambridge Consultants, or Bugsnag. StyleCI and Cachet are the intellectual property of Alt Three Services Limited.
  7. The Solution Standardizing code style across your workplace or OSS

    can be hard. December 2014 StyleCI created for my personal OSS projects.
  8. • Easy to get started. ◦ One-click enable from StyleCI.

    ◦ Configure from the browser or a .styleci.yml. The Solution
  9. • Easy to get started. ◦ One-click enable from StyleCI.

    ◦ Configure from the browser or a .styleci.yml. • Hours are saved! ◦ No more code style reviews as part of code reviews. ◦ StyleCI can send fixes as PR on demand. ◦ StyleCI can be configured to do this automatically! ◦ StyleCI can be configured to automatically merge its own PRs. ◦ StyleCI can also be configured to directly commit the fixes! The Solution
  10. Automate code style: Don’t let code style take over your

    code reviews. Image source: https://hscenturion.co.za/site/wp-content/uploads/2017/01/besigheidstudies.jpg.
  11. History December 2014 StyleCI created for my personal OSS projects.

    March 2015 Opened to everyone for public repos! July 2015 Launched private repo support and new website. June 2016 Added direct push support. July 2016 New PR analysis system. Q4 2014 Q1 2015 Q2 2015 Q3 2015 Q4 2015 Q1 2016 Q2 2016 Q3 2016 Q4 2016 Q1 2017 Q2 2017 Q3 2017 December 2016 Added Slack notifications.
  12. • StyleCI has to interface with webhooks as well as

    web users. ◦ In fact, 43% of our requests last month were from GitHub webhooks! Architectural Problems
  13. • StyleCI has to interface with webhooks as well as

    web users. ◦ In fact, 43% of our requests last month were from GitHub webhooks! • StyleCI has process commands/events in a good order. ◦ Double hitting repo enables, double hitting plan change forms, lots of commit events. Architectural Problems
  14. • StyleCI has to interface with webhooks as well as

    web users. ◦ In fact, 43% of our requests last month were from GitHub webhooks! • StyleCI has process commands/events in a good order. ◦ Double hitting repo enables, double hitting plan change forms, lots of commit events. • StyleCI has to be correct with it’s fixing. ◦ We don’t want to break people’s code! Architectural Problems
  15. • StyleCI has to interface with webhooks as well as

    web users. ◦ In fact, 43% of our requests last month were from GitHub webhooks! • StyleCI has process commands/events in a good order. ◦ Double hitting repo enables, double hitting plan change forms, lots of commit events. • StyleCI has to be correct with it’s fixing. ◦ We don’t want to break people’s code! • StyleCI has to be high performance. ◦ It has to be able to cope with daily usage. ◦ It has to return the results as fast as possible. Architectural Problems
  16. StyleCI is Built Using Laravel 5! The Laravel Framework and

    the Laravel Trademark is the intellectual property of Taylor Otwell.
  17. • We have commands and handlers • Some commands are

    async • Commands never return data • Commands may omit events • Commands may throw exceptions Commands
  18. • We have events and handlers • All handlers are

    synchronous • Some handlers are “crashable” Events
  19. What are you waiting for? Sign up today for free,

    and get unlimited public repos. Paid plans are also available for private repos. https://styleci.io/