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

New pre commit check for release note bullet point format #10

Merged
merged 7 commits into from
Oct 25, 2023

Conversation

jhaigh0
Copy link
Contributor

@jhaigh0 jhaigh0 commented Oct 24, 2023

Required for mantidproject/mantid#36202

When mantid combines release notes into larger grouped files, if release notes have mismatched bullet point styles (- vs * for example) when sphinx will give a warning and the docs build will fail. Officially Mantid standards say all release note should use a - so this pre commit hook will enforce that.

I've added some unit tests to go along side any manual testing.

This is all pretty much lifted from the repo I made here thinking that we didn't have one already...

Copy link
Contributor

@robertapplin robertapplin left a comment

Choose a reason for hiding this comment

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

So far I have just done a code review. I have two minor suggestions

for filename in filenames:
with open(filename, 'r') as rn:
lines = rn.readlines()
for i in range(len(lines)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to avoid using a range-based for loop by just iterating through each element in the list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I wanted the index so I could change the value in the list on line 32.

mantid_release_note_check/mantid_release_note_check.py Outdated Show resolved Hide resolved
jhaigh0 and others added 3 commits October 24, 2023 14:55
Signed-off-by: mantid-builder <mantid-builder@hosting.com>
Signed-off-by: mantid-builder <mantid-builder@hosting.com>
Copy link
Contributor

@robertapplin robertapplin left a comment

Choose a reason for hiding this comment

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

The changes look good and have already been tested from @jhaigh0 's repo. Out of interest, what are the windows and darwin clang executables for?

@jhaigh0
Copy link
Contributor Author

jhaigh0 commented Oct 25, 2023

The changes look good and have already been tested from @jhaigh0 's repo. Out of interest, what are the windows and darwin clang executables for?

Those commits were added by the pre commit checks which ran.

@cailafinn cailafinn merged commit 5e10ad0 into main Oct 25, 2023
@cailafinn cailafinn deleted the release_note_check branch October 25, 2023 13:05
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.

3 participants