HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Beware the 4-spacening this week (25 May)

2

Comments

  • LincLinc Admin

    @hgtonight said:
    Are you using an IDE code formatting function to update the files?

    We are! Todd used PhpStorm.

  • LincLinc Admin

    Spacening has landed! Pull yer repos.

  • :lol:;)

    grep is your friend.

  • Exciting times! :D

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • LincLinc Admin

    Lord Brackos have mercy. Now it's the Casening & Brackos' Revenge: https://github.com/vanilla/vanilla/pull/2792

  • chanhchanh ✭✭

    Would someone to see if your ruleset.xml and Sniffs work with the latest version of CodeSniffer like 2014 not 2012?

  • LincLinc Admin

    They don't. The latest version it works with is 1.5.6.

  • chanhchanh ✭✭

    That explain it because I try Vanilla rules with the latest version and it does nothing.

  • LincLinc Admin

    We only became aware of the issue this past week. Hopefully an intrepid developer will sort it out soon.

  • BleistivtBleistivt Moderator

    A few questions regarding the new naming standards:

    • How should Hooks be called? discussionController_render_before or DiscussionController_render_before since it contains a class name?
    • Should plugin names/folders be in camelCase or even lowercase? What about the class name? I see editor is called EditorPlugin for example.
    • What about factory functions that return objects like Gdn::UserModel()?
    • Should new permissions be in camelCase?
    • Should new tables/columns be in camelCase?
  • @Linc said:
    We are! Todd used PhpStorm.

    My coding standard always has been "whatever pressing Ctrl+Alt+L in PhpStorm does".
    I can't really care more than that. :lol:

  • BleistivtBleistivt Moderator

    @Bleistivt said:
    A few questions regarding the new naming standards:

    • How should Hooks be called? discussionController_render_before or DiscussionController_render_before since it contains a class name?
    • Should plugin names/folders be in camelCase or even lowercase? What about the class name? I see editor is called EditorPlugin for example.
    • What about factory functions that return objects like Gdn::UserModel()?
    • Should new permissions be in camelCase?
    • Should new tables/columns be in camelCase?

    In addition to that:

    If a variable holds an object, should it be in StudlyCaps?

  • R_JR_J Admin

    I try to adhere to standards, but already your questions make my head ache... o.O

  • There is no perfect standard it is about constituency. I hope once settled on a standard they stick to it.

    grep is your friend.

  • LincLinc Admin
    edited June 2015

    How should Hooks be called?

    discussionController_render_before is correct.

    Should plugin names/folders be in camelCase or even lowercase? What about the class name? I see editor is called EditorPlugin for example.

    New plugin folders & slugs should be lowercase, but I do not believe we will be changing existing ones at this time.

    What about factory functions that return objects like Gdn::UserModel()?

    Methods & functions will all move to camelCase.

    Should new permissions be in camelCase?

    No, permissions and config settings will keep StegosaurusCase (as do class names).

    Should new tables/columns be in camelCase?

    No, the database is an all-or-nothing proposition and we're not prepared to alter its structure at this time. It remains StegoCase, to our eternal chagrin.

    If a variable holds an object

    Doesn't matter what it holds; all new variables get camelCase moving forward.

  • LincLinc Admin
    edited June 2015

    I do believe this document is an accurate reflection of the new standards, which we put together a year ago: http://docs.vanillaforums.com/developers/contributing/coding-standard/ The dev team had a presentation last week to refresh everyone on the new standard since we're pushing it now.

  • LincLinc Admin

    Today I figured out how to make CodeSniffer autocorrect all our braces & bool/null casing.

    https://www.youtube.com/watch?v=9E506brpCBw

  • LincLinc Admin

    Branch the-stagening holds 3 giant PRs combined for testing that we didn't break anything during this process.

  • @Linc said:
    No, the database is an all-or-nothing proposition and we're not prepared to alter its structure at this time. It remains StegoCase, to our eternal chagrin.

    No chagrin. "StegoCase" is ok to read, unlike camelCase (it's one of my pet peeves about Java[Script]). I've never seen a database using camelCase, and I hope that I will never do. :)

Sign In or Register to comment.