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

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

  •  05-12-2019
  •  | 
  •  

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

Thanks,

Brandon

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top