Markcop is our friendly Markdown enforcer.
To make your first contribution to a Hack Club repo, please read over our contribution guidelines.
The following is a guide for contributing a new markdown test to this repo.
-
Add a function that takes the file name as the its first argument, and the file contents as the second
# Markdown checking functions function my_check { file_name="$1" my_check_errors_in_file=false for line in $(echo "$2"); do my_check_errors_in_file=true # Failed checks should print red 'x's printf "${RED}x${NC}" errors="${errors}\n${line} fails my_check!" done if [ $my_check_errors_in_file = true ]; then return 1 fi # Successful checks should print green dots printf "${GREEN}.${NC}" return 0 }
-
Add the function name to the
CHECKS
arrayCHECKS=(my_check trailing_whitespace malformed_header header_missing_newline long_line missing_link eof_newline)
Copy and paste the following into your terminal to run Markcop on all of the Markdown in your current git repo (must have Docker installed):
docker run -v $(pwd):/app hackclub/markcop
If you'd like to only run Markcop on specific files, you can pass in the files to check as arguments. Example:
docker run -v $(pwd):/app hackclub/markcop README.md CONTRIBUTING.md
Run the following to run Markcop in its Docker container in development (make sure to run this from the root of the repo):
docker run -v $(pwd):/app -v $(pwd):/markcop hackclub/markcop
See LICENSE.