Check for presents of :local: keyword.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 13:31:27 +0200
changeset 73 7ed63a934571
parent 72 6cc2c19c8995
child 74 69323ee4fd3a
Check for presents of :local: keyword.
Makefile
--- a/Makefile	Mon Feb 22 13:12:06 2016 +0200
+++ b/Makefile	Mon Feb 22 13:31:27 2016 +0200
@@ -197,15 +197,18 @@
 .PHONY: check-format-policy
 check-format-policy:
 	\
-for f in *.rst; do \
-  if grep '.. -\*- coding: utf-8; -\*-' $$f >/dev/null; then :; else \
+for f in $(RST_FILES); 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 \
+  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 \
+  if grep '^.. contents::' $$f >/dev/null; then :; else \
     echo $$f:7:" Has no 'contents::' directive."; \
   fi; \
+  if grep '^   :local:' $$f >/dev/null; then :; else \
+    echo $$f:7:" Has no ':local:' directive."; \
+  fi; \
 done