Skip to content

Fix bug in pathnames when using --fullcheck#201

Merged
james-bruten-mo merged 13 commits intoMetOffice:mainfrom
r-sharp:path_bugfix
Mar 9, 2026
Merged

Fix bug in pathnames when using --fullcheck#201
james-bruten-mo merged 13 commits intoMetOffice:mainfrom
r-sharp:path_bugfix

Conversation

@r-sharp
Copy link
Contributor

@r-sharp r-sharp commented Mar 3, 2026

PR Summary

Sci/Tech Reviewer:
Code Reviewer: @james-bruten-mo

The TLD(Top Level Directory, as specified with the -p|--path argument) was being repeated when using --fullcheck option. Not sure how this crept in, but I discovered it when trying to work on some optimisations.

Whilst the propesed 'fix' might look a bit clunky (generating relative paths to the TLD in get_files_to_check only to add the TLD once the list is returned). This is to accomodate planned changes to only add the TLD at the point the file is opened and always use just the relative path when reporting on the success/failure of a particular file.
I'm fixing the bug here - no implementing the future change.

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • This change has been tested appropriately (please describe)

On the command line, this change allows the script to run on a specified directory in both 'cms' and fullcheck modes.
It also passes all the pytest tests.

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

AI only used for "line completion" where it matched what I was going to type.

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Security considerations have been addressed
  • Performance impact is acceptable

Copy link
Collaborator

@james-bruten-mo james-bruten-mo left a comment

Choose a reason for hiding this comment

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

Looks good, cheers

@james-bruten-mo james-bruten-mo merged commit ef0217d into MetOffice:main Mar 9, 2026
8 checks passed
@r-sharp r-sharp deleted the path_bugfix branch March 9, 2026 15:10
r-sharp added a commit to r-sharp/SimSys_Scripts that referenced this pull request Mar 9, 2026
* Yet another weird round of having to repeatedly accept the same changes which git / VS Code are marking as in conflict.
Annoyingly, this seems to have introduced a bug as well.

* Fixing issue with external runners not establishing properly.

* Fixing an error that seems to have crept in during merging main and resolving clashes. But looking at it, I really can't fathom out 'how'

* Where do these line length errors in the linter(s) come from - I haven't edited this file...

* quick "improvement" to the error reporting in one of the tests

* Why am I constantly having to re-impliment fixes/tidying I'm sure I've done before.

* And now ruff_format wants to change them back again...

* Fix issue with "TLD" being repeated for paths when using --fullcheck

* Undoing auto formatting again as github CI doesn't agree with it (picard.gif)
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