{"id":21091338,"url":"https://github.com/andreasscherbaum/check-markdown-files","last_synced_at":"2026-02-01T03:01:45.451Z","repository":{"id":229518958,"uuid":"766247584","full_name":"andreasscherbaum/check-markdown-files","owner":"andreasscherbaum","description":"Run a pre-flight check on Markdown files before committing blog postings","archived":false,"fork":false,"pushed_at":"2025-06-22T01:21:13.000Z","size":386,"stargazers_count":1,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T02:32:15.655Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreasscherbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-02T18:29:46.000Z","updated_at":"2025-06-22T01:21:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"7cdad5b3-d459-4cbf-9bed-ef42076cb543","html_url":"https://github.com/andreasscherbaum/check-markdown-files","commit_stats":null,"previous_names":["andreasscherbaum/check-markdown-files"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andreasscherbaum/check-markdown-files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fcheck-markdown-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fcheck-markdown-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fcheck-markdown-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fcheck-markdown-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreasscherbaum","download_url":"https://codeload.github.com/andreasscherbaum/check-markdown-files/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fcheck-markdown-files/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28965436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T21:45:13.411Z","updated_at":"2026-02-01T03:01:45.436Z","avatar_url":"https://github.com/andreasscherbaum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# check-markdown-files\n\nRun a pre-flight check on Markdown files before committing blog postings\n\n## Usage\n\nRun this script from inside your `git` repository with your blog Markdown files.\n\nThe script will attempt to find the file `check-markdown-files.conf` in the root of your repository, which includes your configuration.\n\n## git Commit Hook\n\nIn order to use this script as `git commit` hook, you have to execute it from `.git/hooks/pre-commit`, or make this script a symlink (*Linux*/*Unix* only).\n\nThe following example assumes that you are currently in the root directory of your blog repository, and this repository is checked out next to your blog repository.\n\n```\ncd .git/hooks/ \u0026\u0026 ln -s ../check-markdown-files/check-markdown-files.py pre-commit \u0026\u0026 cd -\n```\n\n## Configuration\n\nIn `check-markdown-files.conf`, the following checks and config options are available. All checks are disabled by default, and can be enabled in the configuration file.\n\nIf a check is enabled, it applies to all Markdown files (global configuration). Most checks can be disabled on a local level, using flags in the `suppresswarnings` header in Frontmatter.\n\nAll available checks are listes in the [CHECKS](CHECKS.md) document.\n\n## Write a new check\n\nAdd the following parts:\n* Default in `read_config` in `check-markdown-files.py`\n* Add the call for the check in `handle_markdown_file` in `check-markdown-files.py`\n* Write the actual function for the check:\n  * The function receives the following parameters\n    * a copy of the config\n    * the full content of the file, as currently in progress\n    * the filename of the currently processed file\n    * the Frontmatter header, from initial reading the file (not updated during the execution of the different tests)\n  * The function returns the content of the file, potentially modified\n* Add documentation in `CHECKS.md`\n* Add one or more tests for the check in `tests/`\n  * Add the test(s) in `tests.yml`\n\n## Tests\n\nAll tests are found in the `tests/` directory, or a subdirectory. Tests are defined in the `tests.yml` file, and run by the `run-tests.py` script.\n\n### Write a new test\n\nAdd the new test in `tests.yml`, as example:\n\n```\nnew_test:\n    rc_expected: 0\n    cmdoptions: \"\"\n    test_subdirectory: \"\"\n    stdout_expected: False\n    stderr_expected: False\n    stdout_must_include: []\n    stderr_must_include: []\n    stdout_must_not_include: []\n    stderr_must_not_include: []\n```\n\nThe following options are available:\n\n* `rc_expected`: This is the expected return code of `check-markdown-files.py` when running this test\n* `cmdoptions`: Which additional options to use when running the test\n* `test_subdirectory`: In which subdirectory under `tests` is the test\n* `stdout_expected`: Does this test expect output on stdout - if this is set to false, and output is produced, this is an error\n* `stderr_expected`: Does this test expect output on stderr - if this is set to false, and output is produced, this is an error\n* `stdout_lines_expected`: how many lines are expected on stdout - if the number of lines differ, this is an error\n* `stderr_lines_expected`: how many lines are expected on stderr - if the number of lines differ, this is an error\n* `stdout_must_include`: list of strings which must appear in the stdout output\n* `stderr_must_include`: list of strings which must appear in the stderr output\n* `stdout_must_not_include`: list of strings which must not appear in the stdout output\n* `stderr_must_not_include`: list of strings which must not appear in the stderr output\n\nThe following files are used:\n\n* `tests/new_test.conf`: This is the configfile for the test, enable all tests which should run\n* `tests/new_test.input`: If this file exist, it will overwrite `tests/new_test.md` before the test is run, also `tests/new_test.md` will be deleted afterwards\n* `tests/new_test.md`: The Markdown file for this test\n* `tests/new_test.expected`: If this file exists, the content is matched against `tests/new_test.md` after the test - if the files differ, this is an error\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasscherbaum%2Fcheck-markdown-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreasscherbaum%2Fcheck-markdown-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasscherbaum%2Fcheck-markdown-files/lists"}