java - Way to enforce coding rules with check ins -


currently have verbal agreement in checking code code should complied without errors, unit tested (with unit tests passed), @ least 80% coverage, complexity less 10, documented java comments , should reviewed team. @ point should fine check in (using perforce). know visual studio have team edition can enforce rules , prevent check ins unless rules have been satisfied. use sonar test our code, want prior checking in enforce dev team follow these rules. there such method java perforce or eclipse? thanks

you can use perforce pre-submit trigger, here few examples: http://public.perforce.com/wiki/pre-submit_trigger_examples

update:

since "change-content" pre-commit triggers give access not list of files content of changed files, in principle write trigger applies these changes full content of branch , runs sonar on it.

however, sense triggers typically used brief validations rather more complex processing takes long time execute. longer validations tend belong in continuous integration system rather in source code repository's triggers.

thus, developers able submit changes perforce (with style violations or compile errors), ci system (like jenkins or bamboo) build, run tests, run sonar , yield detailed results per execution phase, giving "offenders" opportunity fix mistakes.

if that's not enough, use ci system "promote" changes upon successful build merging them branch submitted "stable" branch, separate permissions 2 branches if necessary. in particular, new or junior colleagues provided such dedicated staging branches in submit changes, provided inconvenience of allowing them submit directly main branch (and temporarily disturb colleagues) outweighs administrative overhead of maintaining branches.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -