Check for presents of :local: keyword.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 13:31:27 +0200
changeset 1909 6b76120bd2d3
parent 1908 0260f8ffef35
child 1910 123f59618e87
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