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

Allow ignoring files when link checking #2264

Merged
merged 11 commits into from
Feb 4, 2024

Conversation

Raymi306
Copy link
Contributor

@Raymi306 Raymi306 commented Jul 29, 2023

For #2239

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.

The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

@Raymi306
Copy link
Contributor Author

I will address the test failures soon

@Keats
Copy link
Collaborator

Keats commented Dec 7, 2023

Hi @Raymi306 , are you still planning on addressing them?

@Raymi306
Copy link
Contributor Author

Raymi306 commented Dec 9, 2023

I apologize for the delay, I will look into this soon

@Raymi306 Raymi306 force-pushed the zola-check-exclude-directories-#2239 branch from d8f5c3f to 762b404 Compare January 14, 2024 00:05
@Raymi306
Copy link
Contributor Author

Raymi306 commented Jan 14, 2024

I did some updating of my fork and some cherrypicking to try and get this PR back in to shape.
I looked at 2 failing tests and I think that their checks are no longer relevant so I edited the tests to make them pass.
I am a little sick and it has been a long time since I worked on this, I need to write tests for the changes still.

@Raymi306 Raymi306 marked this pull request as ready for review January 14, 2024 21:56
@Raymi306
Copy link
Contributor Author

Raymi306 commented Jan 14, 2024

I note that components/site/link_checking has no tests and is rather monolithic, might be worth a "todo" comment to refactor the code to make it easier to test chunks of?

components/utils/src/globs.rs Outdated Show resolved Hide resolved
src/cmd/serve.rs Outdated Show resolved Hide resolved
@@ -105,6 +106,10 @@ fn should_skip_by_prefix(link: &str, skip_prefixes: &[String]) -> bool {
skip_prefixes.iter().any(|prefix| link.starts_with(prefix))
}

fn should_skip_by_file(file_path: &Path, glob_set: &GlobSet) -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure it's worth a fn if it's only used once in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should_skip_by_prefix was my point of reference here, it also is only used once in this file.

would you like me to remove both?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No that's fine then

components/site/src/link_checking.rs Outdated Show resolved Hide resolved
@Raymi306 Raymi306 requested a review from Keats January 25, 2024 03:46
@Keats Keats merged commit 0098877 into getzola:next Feb 4, 2024
5 checks passed
@Keats
Copy link
Collaborator

Keats commented Feb 4, 2024

Thanks!

veluca93 pushed a commit to veluca93/zola that referenced this pull request May 14, 2024
* Allow ignoring files when link checking

* cargo fmt

* Fix tests

* Remove mystery duplicate function..?

* Add in some mysterious missing code..?

* Simple tests for link checker file globs in config

* cargo fmt

* Remove comment

* convert expect to error propagation

* Address comments

* cargo fmt
Keats pushed a commit that referenced this pull request Jun 20, 2024
* Allow ignoring files when link checking

* cargo fmt

* Fix tests

* Remove mystery duplicate function..?

* Add in some mysterious missing code..?

* Simple tests for link checker file globs in config

* cargo fmt

* Remove comment

* convert expect to error propagation

* Address comments

* cargo fmt
berdandy pushed a commit to berdandy/azola that referenced this pull request Sep 17, 2024
* Allow ignoring files when link checking

* cargo fmt

* Fix tests

* Remove mystery duplicate function..?

* Add in some mysterious missing code..?

* Simple tests for link checker file globs in config

* cargo fmt

* Remove comment

* convert expect to error propagation

* Address comments

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

Successfully merging this pull request may close these issues.

2 participants