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

cylc.nanorc #6072

Merged
merged 3 commits into from
Apr 18, 2024
Merged

cylc.nanorc #6072

merged 3 commits into from
Apr 18, 2024

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Apr 17, 2024

Add a limited amount of Cylc syntax highlighting for Nano - I wrote this a while back, because Nano is my in terminal editor of choice, and handy for smaller toy workflows.

image

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 not included: This is provided as is, on the basis of being better than nothing...
  • CHANGES.md entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at Nanorc cylc-doc#718
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@wxtim wxtim changed the base branch from master to 8.2.x April 17, 2024 15:42
@wxtim wxtim self-assigned this Apr 17, 2024
@wxtim wxtim added the small label Apr 17, 2024
@wxtim wxtim added this to the 8.2.6 milestone Apr 17, 2024
@wxtim wxtim requested a review from MetRonnie April 17, 2024 15:43
color cyan "#.*$"

## Jinja2
icolor red "^#!Jinja2"
Copy link
Member

Choose a reason for hiding this comment

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

What is icolor as opposed to color?

Also, not sure red is a good choice as it tends to mean error/problem

Copy link
Member Author

Choose a reason for hiding this comment

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

icolor is case insensitive regex so it will highlight #!Jinja2 or #!jinja2 or even #!jInJa2 (which is valid!).

The choice of colors is somewhat limited on the older version of Nano we have at the MetOffice, although newer versions of nano offer more choice - when I try I get:

Valid colors are "green", "red", "blue",
"white", "yellow", "cyan", "magenta" and
"black", with the optional prefix "bright"
for foreground colors.

(see also https://www.nano-editor.org/dist/latest/nanorc.5.html)

@MetRonnie

This comment was marked as resolved.

@wxtim
Copy link
Member Author

wxtim commented Apr 18, 2024

Btw, enhancement so should be against master / 8.3.0?

It's an enhancement, but it's very small with no knock on consequences or conceivable side effects and I don't see why it shouldn't go in the earliest possible release.

Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

Nice 👍 Approval pending changelog entry. Also will need adding to cylc-doc. (Do actually follow checklist please!)

change the colour of the jinja2
@wxtim wxtim mentioned this pull request Apr 18, 2024
1 task
@wxtim wxtim requested a review from MetRonnie April 18, 2024 14:18

## Values
color yellow "=(.*)$"
color green "=[^>]"
Copy link
Member

Choose a reason for hiding this comment

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

What's this one about?

Copy link
Member Author

Choose a reason for hiding this comment

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

= signs that aren't => so we don't include graph deps.

@MetRonnie MetRonnie merged commit df10bf5 into cylc:8.2.x Apr 18, 2024
8 of 9 checks passed
@wxtim wxtim deleted the nano-syntax branch April 19, 2024 07:59
wxtim added a commit to wxtim/cylc that referenced this pull request Apr 22, 2024
* upstream/master: (25 commits)
  Delete public DB if private DB does not exist on scheduler start (cylc#6070)
  Include xtrigger function signatures in `cylc config` (cylc#6071)
  Add Nano syntax highlighter (cylc#6072)
  Play should have no cylc rose options (cylc#6068)
  tests/integration: address urwid deprecation warning (cylc#6063)
  Bump dev version
  Prepare release 8.2.5
  add mailmap entry
  Tutorials: avoid validation errors due to implicit tasks
  Update CONTRIBUTING.md
  Update xtrigger_mgr.py documentation
  Another small tweak.
  Tweak previous.
  Tutorials: increase sleep and don't sleep in CI
  Fix bad doctests
  tutorial: make the tutorial workflow run a little slower
  Style tweaks.
  Simply workflow-state code a bit.
  Add unit tests for workflow-state.
  Add to doc string.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants