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

Prevent theme, plugin and author files being created that differ only in case of name #608

Merged
merged 8 commits into from
Mar 22, 2023

Conversation

claremacrae
Copy link
Contributor

@claremacrae claremacrae commented Mar 21, 2023

Changes

  • Introduce class FileNameCaseCollisionsPreventer in utils.py that:
    • builds a list of files in the given directory,
    • and can be used to normalise the names of any output files in that directory
  • Updated .github/scripts/tests/test_utils.py to use the above, when writing notes for:
    • themes
    • plugins
    • authors
  • Also in utils.py:
    • Rename get_output_dir() to get_output_path()
    • Added new get_output_dir() that really does return a directory
    • Added tests for the above

This work was done by pairing with @andynu - who was involved in all commits except the last one, where I moved FileNameCaseCollisionsPreventer to utils.py.

Context:

Checklist

Not applicable...

@claremacrae
Copy link
Contributor Author

I realised a small limitation in what we created...

If a new author releases 2 new themes or plugins in the same week, and capitalises their user name inconsistently, both files will get created, as we don't update the dictionary as each new file comes in...

I say 'small' as the chances of a new author both these is very small:

  • having their first 2 new things accepted in the same week
  • and getting their name inconsistent between them (which is itself very rare)

So, given that we have fixed the most common case, I would really like to get this merged before this week's GitHub Action cron jobs run, if at all possible...

@claremacrae
Copy link
Contributor Author

Hi @kometenstaub, as you have kindly done reviews before, if by any chance you had time to give this a once-over, it would really help.

It was done entirely by pairing - I just can't approve it because we started on my machine, so it's done in my account.

Copy link
Contributor

@kometenstaub kometenstaub left a comment

Choose a reason for hiding this comment

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

I followed all the logic, and it looks good to me! Thank you for implementing this. :)

@claremacrae
Copy link
Contributor Author

Thank you very much!

@claremacrae claremacrae merged commit be08e6f into main Mar 22, 2023
@claremacrae claremacrae deleted the prevent-case-conflicts branch March 23, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants