Skip to content

Instantly share code, notes, and snippets.

@eksperimental
Last active September 4, 2015 03:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eksperimental/fa31a19559b770adca14 to your computer and use it in GitHub Desktop.
Save eksperimental/fa31a19559b770adca14 to your computer and use it in GitHub Desktop.
Check for references to exiting modules in the documentation, that is actually not being liked by ExDoc, in the documentation for the Elixir project
#!/bin/bash
# ./check_not_linked_exdoc.sh – http://git.io/check_not_linked_exdoc.sh
#
# Description:
# Check for references to exiting modules in the documentation, that is actually not being liked
# by ExDoc.
#
# Instructions
# Run from the root folder in the elixir project – https://github.com/elixir-lang/elixir/
#
# Requirements:
# * bash
# * ag (aka the silver searcher) – https://github.com/ggreer/the_silver_searcher
#
# Author:
# eksperimental – https://github.com/eksperimental
for dir in lib/*; do
project=$(echo "${dir}" | sed -e 's@lib/@@')
modules="Elixir|"$(ag -g "Elixir." ${dir}/ebin/ | sed -e 's@^'${dir}'/ebin/Elixir\.@@' -e 's/\.beam$//' | paste -s -d"|")
ag '(?<!>)<code class="inline">('${modules}')[^<(]+(?<!\*)<' doc/${project} -C0
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment