Last active
December 3, 2017 14:05
-
-
Save lelogrott/6992e62b608630a9dbd8091534239880 to your computer and use it in GitHub Desktop.
This script searches for occurrences of exported functions, listed on an input file, in the output of Documenter.jl that lists missing docstrings in the project. Prints the result and also generates an output file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function filter_lines(line) | |
| !startswith(line,"#") && !isempty(line) | |
| end | |
| FILE_exported_functions = open(ARGS[1], "r") | |
| FILE_missing_docstrings = open(ARGS[2], "r") | |
| FILE_output = open("output", "w") | |
| exported_functions = readstring(FILE_exported_functions) | |
| missing_docstrings = readstring(FILE_missing_docstrings) | |
| lines = filter(filter_lines, split(exported_functions, "\n")) | |
| functions = [] | |
| for line in lines | |
| splited = split(line, r"\s*,\s*") | |
| for function_prototype in splited | |
| full_name = string("LightGraphs.", function_prototype, " :: ") | |
| full_name_without_params = string("LightGraphs.", function_prototype, "\n") | |
| if contains(missing_docstrings, full_name) || contains(missing_docstrings, full_name_without_params) | |
| push!(functions, function_prototype) | |
| write(FILE_output, "$full_name\n") | |
| end | |
| end | |
| end | |
| print(functions) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EXAMPLES
FILE_exported_functions:
FILE_missing_docstrings: