Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pre-commit-hook configuration to this repo #2932

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .pre-commit-hooks.yaml
@@ -0,0 +1,10 @@
- id: mkdocs-build
name: mkdocs build
description: tests if your documentation builds successfully.
language: python
entry: mkdocs build
require_serial: true
pass_filenames: false
types_or: [markdown, yaml]
files: ((^|/)mkdocs\.ya?ml$)|(^docs/)
Cube707 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@mondeja mondeja Apr 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the files field should be just removed as said previously you can change the docs directory and configuration file path.

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But based on what @Cube707 explained, this value is just a default value which makes sense in most cases. Users can change it in their projects if needed.

Copy link
Author

@Cube707 Cube707 May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes what @pawamoy said. But also the files field is responsible for limiting what files trigger a mkdoc build and if removed it will run for changes to any file. As mkdoc is quite expencive to run it should defnetly be limited in when it runs.

An argument could be made here to match no files at all by default, making it that it must be run manually (via pre-commit run mkdocs-build) or the user must provide/overide the file patterns

minimum_pre_commit_version: 2.9.0