Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

some codesniffer niceups #2

Closed
jbrekle opened this issue Oct 12, 2011 · 11 comments
Closed

some codesniffer niceups #2

jbrekle opened this issue Oct 12, 2011 · 11 comments
Assignees
Milestone

Comments

@jbrekle
Copy link
Member

jbrekle commented Oct 12, 2011

Hi,

i just tested the cs stuff, and i really like it!

I had already installed the CodeSniffer pear library, and cs-install says it fails, because of that, but actually succeeds. maybe you ignore that error there. (should also occur when cs-uninstalling and then cs-install again - because the uninstall doesnt uninstalls the pear stuff)

and if i add a var_dump or print_r (and also exit and echo), i would like cs to complain about that. is there a simple way to disable cs for one(current) commit? for example: i fix all cs errors that i can, but some remain (for example a print_r to the log).

@seebi also suggested that you could make something that prevents us from commiting to the master branch.

what do you think?

regards,
Jonas

@ghost ghost assigned larseidam Oct 12, 2011
@seebi
Copy link
Member

seebi commented Oct 12, 2011

yes please!

maybe we have different level here:
level 0:

  • only hardcore errors do block the commit, including trying to commit into the master branch
  • this is established with "make install" so its default
    level 1:
  • our suggested level of quality checks, which is more accurate

btw: does make cs-install works on Darwin as well @pfrischmuth, maybe you can test that?

@seebi seebi closed this as completed Oct 12, 2011
@seebi seebi reopened this Oct 12, 2011
@seebi
Copy link
Member

seebi commented Oct 12, 2011

sorry, wrong button ... :)

@seebi
Copy link
Member

seebi commented Oct 17, 2011

additional requests:

  • cs-install should test for root (to avoid errors)
  • 2x cs-install crashes
  • bad words: var_dump, exit; die, _POST, _GET, _REQUEST
  • keine tabs
  • no whitespaces at the end of the line

@seebi
Copy link
Member

seebi commented Oct 22, 2011

after working a little bit with the pre_commit hook, I would like to change that to pre_push if this exist:
the reason: implementing a feature and fixing the code quality should be different commits and I can't commit the feature first ...

what do you think about that?

@seebi
Copy link
Member

seebi commented Nov 11, 2011

@Lars: what about this issue? These additional requirements are important:

  • cs-install should test for root (to avoid errors)
  • 2x cs-install crashes
  • test for bad words: var_dump, exit; die, _POST, _GET, _REQUEST
  • test for tabs
  • test for whitespaces at the end of the line

@seebi
Copy link
Member

seebi commented Nov 16, 2011

can we drop Internal.NoCodeFound errors on "make cs-check"

these errors appear on Makefiles, N3 files, ...

@Lars
Copy link

Lars commented Nov 17, 2011

Seebi, the opening user was @larseidam not myself.

Thanks

@seebi
Copy link
Member

seebi commented Nov 19, 2011

@Lars: thanks ... and sorry :)

@larseidam
Copy link
Member

@ALL

now there is a CodeSniffer Update on commit 714ce22

Attention: some Makefile commands have changed (look at 'make help')

fixed issue:

  • cs-install should test for root (to avoid errors)
  • 2x cs-install crashes
  • test for bad words: var_dump, exit; die, _POST, _GET, _REQUEST (also print_r and error_log)
  • test for tabs
  • test for whitespaces at the end of the line
  • install CS on submodules/extensions
  • run CS with specific sniffs

open issue:

  • wikipage for sniff explanation
  • CS integration for Vim
  • forbid the committing in the master branch
  • install CS on all submodules/extensions

@seebi

What do you mean with this??

can we drop Internal.NoCodeFound errors on "make cs-check"
these errors appear on Makefiles, N3 files, ...

Do you want a sniff that shows files they have no php code, files they are empty or something else??
Maybe we can talk about it on our meeting today.

@seebi
Copy link
Member

seebi commented Nov 21, 2011

lars, looks great!

regarding your question: I just dont want an error if the sniffer founds a file which is not php

one solution: the sniffer looks only for php and phtml files
another solution: it looks in every file but do not complain about files without php code

UDFR added a commit to CDLUC3/OntoWiki that referenced this issue Jan 26, 2012
@larseidam
Copy link
Member

all issues in this thread are done or rather in a other Issus-thread

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants