How do I make Mercurial require files to have documentation (Javadoc, etc) before pushing?

StackOverflow https://stackoverflow.com/questions/5096160

  •  05-12-2019
  •  | 
  •  

Domanda

Is this something that is currently possible via extension or native functionality?

Thanks,

Brandon

È stato utile?

Soluzione

You would want a pre-commit hook that would call out to your "validate document" program. Then based on the response to the document validation, you could permit/deny the hook.

Altri suggerimenti

Hmm, I forgot about pre-commit hooks.

If you are working in the Java world, you could use tools such as checkstyle to check for Javadocs as a part of your build to enforce coding standards and such which may include having Javadocs for all code.

Documenting code should be each developers responsibility and they should take it to heart. Even with tools such as checkstyle or using a pre-commit hook, you can only enforce some Javadocs being present in the code but not control the quality of the documentation.

If you follow good practices such as adherence to coding standards and solid peer code reviews, it will alleviate the need for you requiring Hg to check for Javadocs before checking code in.

Just my 2c.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top