changeset 35:648d3bf5204d

Add 'check-format-policy' target.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Sun, 15 Jul 2012 14:50:25 +0300
parents 1f66a9cac81d
children 7fb39a216cef
files Makefile
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun Jul 15 14:31:34 2012 +0300
+++ b/Makefile	Sun Jul 15 14:50:25 2012 +0300
@@ -134,8 +134,23 @@
 ################################################################
 # Helper target.
 
+.PHONY: help
 help:
 	@echo Supported targets:
 	@sed -n -e '/^[[:alnum:]_-]*:/{s=^\(.*\):.*=  \1=;p;}' $(MAKEFILE_LIST)
 
+.PHONY: check-format-policy
+check-format-policy:
+	\
+for f in *.rst; do \
+  if grep '.. -\*- coding: utf-8; -\*-' $$f >/dev/null; then :; else \
+    echo $$f:1:" Has no 'coding: utf-8' directive."; \
+  fi; \
+  if grep '.. include:: HEADER.rst' $$f >/dev/null; then :; else \
+    echo $$f:2:" Has no 'include:: HEADER.rst' directive."; \
+  fi; \
+  if grep '.. contents::' $$f >/dev/null; then :; else \
+    echo $$f:7:" Has no 'contents::' directive."; \
+  fi; \
+done