Skip to content

Commit

Permalink
Remove vim.lang from syntax
Browse files Browse the repository at this point in the history
Point users of Cylc Get Resources to the new cylc.vim plugin.
  • Loading branch information
wxtim committed Jan 10, 2025
1 parent 26df668 commit 3f71495
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 117 deletions.
1 change: 1 addition & 0 deletions changes.d/6549.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed cylc.vim - you should use https://github.com/cylc/cylc.vim instead.
115 changes: 0 additions & 115 deletions cylc/flow/etc/syntax/cylc.vim

This file was deleted.

13 changes: 11 additions & 2 deletions cylc/flow/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

"""Extract named resources from the cylc.flow package."""

from ansimarkup import parse
from contextlib import suppress
from pathlib import Path
from random import choice
Expand All @@ -39,10 +40,10 @@
RESOURCE_NAMES = {
'syntax/cylc-mode.el': 'Emacs syntax highlighting.',
'syntax/cylc.lang': 'Gedit (gtksourceview) syntax highlighting.',
'syntax/cylc.vim': 'Vim syntax highlighting.',
'syntax/cylc.xml': 'Kate syntax highlighting.',
'cylc-completion.bash': 'Bash auto-completion for Cylc commands.',
'cylc': 'Cylc wrapper script.',
'!syntax/cylc.vim': 'Deprecated - use https://github.com/cylc/cylc.vim',
}
API_KEY = 'api-key'

Expand All @@ -63,7 +64,15 @@ def list_resources(write=print, headers=True):
write('Resources:')
max_len = max(len(res) for res in RESOURCE_NAMES)
for resource, desc in RESOURCE_NAMES.items():
write(f' {resource} {" " * (max_len - len(resource))} # {desc}')
if resource[0] == '!':
# Use ! to indicated that resource is deprecated:
resource = resource[1:]
write(parse(

Check warning on line 70 in cylc/flow/resources.py

View check run for this annotation

Codecov / codecov/patch

cylc/flow/resources.py#L69-L70

Added lines #L69 - L70 were not covered by tests
f'<yellow> {resource} {" " * (max_len - len(resource))}'
f' # {desc}</yellow>'
))
else:
write(f' {resource} {" " * (max_len - len(resource))} # {desc}')

Check warning on line 75 in cylc/flow/resources.py

View check run for this annotation

Codecov / codecov/patch

cylc/flow/resources.py#L75

Added line #L75 was not covered by tests
if headers:
write('\nTutorials:')
for tutorial in tutorials:
Expand Down
9 changes: 9 additions & 0 deletions cylc/flow/scripts/get_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import sys

from cylc.flow import LOG
from cylc.flow.exceptions import CylcError
import cylc.flow.flags
from cylc.flow.loggingutil import set_timestamps
from cylc.flow.option_parsers import CylcOptionParser as COP
Expand Down Expand Up @@ -74,6 +75,14 @@ def get_option_parser():

@cli_function(get_option_parser)
def main(parser, opts, resource=None, tgt_dir=None):

# Intercept requests for syntax/cylc.vim:
if resource == "syntax/cylc.vim":
raise CylcError(

Check warning on line 81 in cylc/flow/scripts/get_resources.py

View check run for this annotation

Codecov / codecov/patch

cylc/flow/scripts/get_resources.py#L81

Added line #L81 was not covered by tests
'syntax/cylc.vim has been replaced by '
'https://github.com/cylc/cylc.vim'
)

if cylc.flow.flags.verbosity < 2:
set_timestamps(LOG, False)
if not resource or opts.list:
Expand Down

0 comments on commit 3f71495

Please sign in to comment.