Ticket #48 (closed enhancement: fixed)

Opened 3 years ago

Last modified 5 months ago

Improve check-style target

Reported by: schst Owned by: rist
Priority: minor Milestone: 0.6.0
Component: Build System Version: SVN-trunk
Keywords: Cc:

Description

PHP_CodeSniffer should be used to automate the CS checks.

This requires, that we define exact coding styles and implement them as rules for PHP_CodeSniffer.

Change History

Changed 3 years ago by schst

  • owner changed from mikey to schst

Changed 3 years ago by schst

  • status changed from new to assigned

Changed 3 years ago by mikey

  • milestone set to 0.5.0

Changed 3 years ago by mikey

  • owner changed from schst to rist
  • status changed from assigned to new

Changed 3 years ago by mikey

  • owner changed from rist to mikey
  • status changed from new to assigned

Changed 3 years ago by mikey

  • owner changed from mikey to rist
  • status changed from assigned to new

Changed 3 years ago by mikey

Changesets 1125 and 1126 imported a first version of this.

Changed 3 years ago by mikey

Some remarks after first test runs:

  • There seems to be a problem with the indention in switch statements. See net::stubbles::events::stubEventsXJConfInitializer::getDescriptor() for an example.
  • Missing doc comments seem not to be recognized, net::stubbles::ioc::stubBindingScope::getInstance() had no doc comment.
  • Current rule for cast statements require no space after cast statement, but should be that a space is required. See net::stubbles::ipo::request::filters::stubFloatFilter::execute() for an example.
  • Conditional includes with require should not be an error, see net::stubbles:util::ext classes.

Changed 3 years ago by rist

  • status changed from new to assigned

Changed 3 years ago by rist

Fixed issues - except for switch statement because there are conflicting sniffs which interfere with each other. Docblock sniffs are also yet missing. I'll continue the work on this.

Changed 3 years ago by rist

switch statements work now with changeset:1173. Docblocks will be next ...

Changed 3 years ago by mikey

Meanwhile PHP_CodeSniffer 1.0 was released. One new feature is that you can specify the full path to a coding standard, which would allow us to remove the copy-standards target from our build file.

Unfortunately there was a change in our of the sniffs we are using, too: Squiz ClassDeclarationSniff now ensures there is one blank line after a class closing brace We need to replace this with our own, as we do not want blank lines after class closing braces.

Changed 3 years ago by mikey

  • milestone changed from 0.5.0 to 0.6.0

Changed 3 years ago by rist

Updated PHP_CodeSniffer to v1.0 and removed unnecessary build targets. Omitted also SquizClassDeclarationSniff and created own sniff. Now there is only the check-style target... see changeset:1257 and changeset:1261.

Changed 3 years ago by rist

  • status changed from assigned to closed
  • resolution set to fixed

Coding Standards are now established, with these last improvements:

docblocks checks:

whitespace checks:

misc:

Note: See TracTickets for help on using tickets.