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

Lint S014: Only warn about -W when used for LSF #6551

Merged
merged 6 commits into from
Jan 15, 2025

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Jan 10, 2025

Closes #6550

-W should only be highlighted by Cylc lint when being used in a way which indicates use of LSF.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Very small, self documenting.
  • Raised against 8.4.x, bugfix

@wxtim wxtim self-assigned this Jan 10, 2025
@wxtim wxtim force-pushed the lint.disambiguate_-W branch from 575053f to 404adc1 Compare January 10, 2025 15:36
cylc/flow/scripts/lint.py Outdated Show resolved Hide resolved
@wxtim wxtim force-pushed the lint.disambiguate_-W branch from 316ded6 to fef13fb Compare January 10, 2025 15:41
@wxtim wxtim modified the milestones: 8.5.0, 8.4.1 Jan 10, 2025
@wxtim wxtim added bug Something is wrong :( small labels Jan 10, 2025
@oliver-sanders
Copy link
Member

I found some suggestion in the user guide that the time can take a longer format:

Resource_List.walltime = 00:30:00

#PBS -l walltime=1:00:00

qsub -l ncpus=16 -l walltime=4:00:00 mysubrun

Maybe: (\d{2}:)+.

Might be worth quickly running this rule over avaliable cylc-run dirs to make sure there aren't any false positives.

@wxtim
Copy link
Member Author

wxtim commented Jan 10, 2025

I found some suggestion in the user guide that the time can take a longer format:

This regex is only supposed to match LSF format wallclock strings, avoiding PBS -W which look superficially similar.

The PBS check one will match any case where -l wallclock is present.

I've added an extra test to demonstrate my point.

@MetRonnie MetRonnie changed the title Lint: Only warn about -W when used for LSF Lint S014: Only warn about -W when used for LSF Jan 13, 2025
@oliver-sanders
Copy link
Member

Can't find any false positives in the first 2000 workflows scanned, 👍

changes.d/6551.fix.md Outdated Show resolved Hide resolved
cylc/flow/scripts/lint.py Outdated Show resolved Hide resolved
cylc/flow/scripts/lint.py Outdated Show resolved Hide resolved
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

FYI: There's an (ironic?) lint error on this branch to resolve.

cylc/flow/scripts/lint.py Outdated Show resolved Hide resolved
@MetRonnie MetRonnie merged commit 0d204cc into cylc:8.4.x Jan 15, 2025
27 checks passed
@wxtim wxtim deleted the lint.disambiguate_-W branch January 15, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :( small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cylc lint mistakenly picks up PBS -W directive as LSF time limit directive
3 participants