# HG changeset patch # User Oleksandr Gavenko # Date 1342353025 -10800 # Node ID a1dffeaaf6e4163552af3f7f0a7e90fbb0b21a07 # Parent 4a4dabb9f8e4b16432b8c7b9ad09d86241f2804a Add 'check-format-policy' target. diff -r 4a4dabb9f8e4 -r a1dffeaaf6e4 Makefile --- 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