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

ENH: Support watching single files #118

Open
snowman2 opened this issue Jul 7, 2022 · 2 comments
Open

ENH: Support watching single files #118

snowman2 opened this issue Jul 7, 2022 · 2 comments

Comments

@snowman2
Copy link

snowman2 commented Jul 7, 2022

Context

In the base directory of a repository, there can be files such as CONTRIBUTING.md that are included in the docs by reference:

\```{include} ../CONTRIBUTING.md
\```

Proposal

It would be nice to be able to watch a specific set of files:

--watch *.md

Otherwise, there is going to be a long list of ignores.

Tasks and updates

No response

@welcome

This comment was marked as off-topic.

@choldgraf
Copy link

I've got a PR to add glob-style ignore matching here:

I think if that is merged, it should be pretty easy to implement this with logic like:

  • Support --watch path/to/file.md or --watch path/to/*.md
  • watch_files = glob(<that-expression>)
  • all_files = glob("**/*", recursive=True)
  • ignore_files = [ii for ii in all_files if ii not in watch_files]

And then append ignore_files to the list that is created if somebody used the --ignore flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants