Skip to content

Conversation

@lukeryannetnz
Copy link

This is my first contribution to this project, the issue was labelled as [GoodFirstIssue] so I jumped in. As such, any feedback or guidance 💯 appreciated.

Make ReadDir function variadic. Optional second param specifies FileSystem. The default if not specified remains work dir, to retain backwards compatibility.

I largely followed the breadcrumbs @bep left in the issue comments (thanks!). Things I'm not sure about:

  • how best to support the static FS given when in multihost we have one static filesystem per language
  • if I need to better test my input checks in os
  • how best to update docs (I can spend time looking at this if I get positive feedback on this change)

Fixes #9604

@CLAassistant
Copy link

CLAassistant commented Mar 5, 2022

CLA assistant check
All committers have signed the CLA.

@bep
Copy link
Member

bep commented Mar 5, 2022

Thanks for this -- the code looks great at first glance. I will need to understand and fix #9609 before I can merge this.

But if I could ask for one change that would make this easier to review:

Instead of creating one test function per variant, I suggest you combine them into one and separate the expectations by an identifier, e.g.:

START  assets:|asset.jpg|:END:
START static:|static.jpg|:END:
...

And if you create an inline template to print this, you get a pretty compact test.

@lukeryannetnz
Copy link
Author

lukeryannetnz commented Mar 6, 2022

Thanks for the feedback, I've combined the tests so they are easier to read as suggested.
Also added a todo to make the gap in the functionality explicit.

I'm a little confused about the failing build, looks like it might have timed out. If you can approve the workflow, I'll look into it if it happens again.

@lukeryannetnz
Copy link
Author

Updated test to include a check for composite archetype files.

@lukeryannetnz
Copy link
Author

Had a go at adding docs for the new functionality.

Make ReadDir function variadic. Optional second param specifies FileSystem. The default if not specified remains work dir, to retain backwards compatibility.

Fixes gohugoio#9604
@lukeryannetnz
Copy link
Author

@bep any interest in taking another look at this?

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
Please check https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md#code-contribution and verify that this code contribution fits with the description. If yes, tell is in a comment.
This PR will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the Stale label May 31, 2023
@github-actions github-actions bot closed this Jul 27, 2023
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3 participants