1

Is there a mechanism to identify incoming source code signatures and in-line source code documentations via GIT or SVN.

For Example: If someone commits a Java code to a source control this interceptor should validate all the method names and check for JavaDoc above it, if there is no documentation available for one Java method then the commit should not happen.

Is this really possible?, Can any one tell if there is a ready made mechanism or macro option available?

Dickens A S
  • 3,824
  • 2
  • 22
  • 45

1 Answers1

0

Git and subversion both support the notion of hooks. What you would do is have your code analysis tools run as pre-commit or post commit hooks.

The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that’s .git/hooks. When you initialize a new repository with git init, Git populates the hooks directory with a bunch of example scripts, many of which are useful by themselves; but they also document the input values of each script. All the examples are written as shell scripts, with some Perl thrown in, but any properly named executable scripts will work fine – you can write them in Ruby or Python or what have you. If you want to use the bundled hook scripts, you’ll have to rename them; their file names all end with .sample.

You can find some information here.

ojblass
  • 21,146
  • 22
  • 83
  • 132