https://github.com/cylc/cylc-textmate-grammar

TextMate grammar for Cylc workflow configuration files

https://github.com/cylc/cylc-textmate-grammar

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords

cylc textmate-grammar

Keywords from Contributors

scheduling autograder sequences projections standardization interpretability hack generalization report meshing
Last synced: 9 months ago · JSON representation

Repository

TextMate grammar for Cylc workflow configuration files

Basic Info
  • Host: GitHub
  • Owner: cylc
  • License: bsd-3-clause
  • Language: JavaScript
  • Default Branch: master
  • Homepage:
  • Size: 321 KB
Statistics
  • Stars: 0
  • Watchers: 6
  • Forks: 5
  • Open Issues: 7
  • Releases: 0
Topics
cylc textmate-grammar
Created about 6 years ago · Last pushed 11 months ago
Metadata Files
Readme Contributing License

README.md

cylc-textmate-grammar

test

This repository provides a TextMate grammar for Cylc workflow configuration (suite.rc and .cylc) files, enabling syntax highlighting and other features.

cylc.tmLanguage.json is the grammar file used by plugins for editors: - VSCode - cylc/vscode-cylc - Atom - cylc/language-cylc

It is also used to build a TextMate bundle at cylc/Cylc.tmLanguage which is compatible with: - TextMate - PyCharm - WebStorm - Sublime Text 3

Usage

If you're using an editor listed above, follow the link next to it for instructions. If not, check cylc/cylc-flow/issues/2752 for support.

Copyright and Terms of Use

Copyright (C) 2008-2025 NIWA & British Crown (Met Office) & Contributors.

License

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contributing

Note: the cylc.tmLanguage.json file is generated from the JavaScript file(s) in src/. Contributors should edit the JavaScript files, not the JSON file; the JSON file should only be generated using the build script (using node).

Getting started

If you are new to TextMate grammars, there are a number of resources to look at: - TextMate manual - language grammars - VSCode syntax highlight guide - Atom flight manual - creating a legacy TextMate grammar

Modifying the grammar

As noted above, instead of editing the cylc.tmLanguage.json file directly (as is done in the VSCode guide, for example) you should edit src/cylc.tmLanguage.js instead.

Each distinct tmLanguage pattern should be represented by a class, whose constructor sets a property called pattern that is an object, e.g.: javascript class LineComment { constructor() { this.pattern = { name: 'comment.line.cylc', match: '(#).*', captures: { 1: {name: 'punctuation.definition.comment.cylc'} } }; } } or a property called patterns that is an array, e.g.: javascript class GraphSyntax { constructor() { this.patterns = [ {include: '#comments'}, new Task().pattern, { name: 'keyword.control.trigger.cylc', match: '=>' }, // etc. Notice above the inclusion of the class Task's pattern object.

Remember that the regex escape character \ needs to be itself escaped. E.g., for the regex \s you need to write \\s.

The exports.tmLanguage object is where the collection of patterns should go, i.e.: javascript exports.tmLanguage = { scopeName: 'source.cylc', name: 'cylc', patterns: [ {include: '#comments'}, ] repository: { comments: { patterns: [ new LineComment().pattern, ] }, graphSyntax: { patterns: [ ...new GraphSyntax().patterns, ] }, // etc. where the spread syntax operator (3 dots) is used to expand the GraphSyntax().patterns array.

Build

To generate the JSON file, you will need NodeJS. After you've made changes to the js grammar file, generate the JSON file using shell npm run build

The compiled result of the examples above would be the following cylc.tmLanguage.json: JSON { "scopeName": "source.cylc", "name": "cylc", "patterns": [ {"include": "#comments"} ], "repository": { "comments": { "patterns": [ { "name": "comment.line.cylc", "match": "(#).*", "captures": { "1": {"name": "punctuation.definition.comment.cylc"} } } ] }, "graphSyntax": { "patterns": [ {"include": "#comments"}, { "name": "meta.variable.task.cylc", "match": "\\b\\w[\\w\\+\\-@%]*" }, { "name": "keyword.control.trigger.cylc", "match": "=>" }, ] } } }

Testing

(Note: if you're unable to run the tests locally, GitHub Actions are set up to automatically run the tests on pull requests.)

If you haven't already installed the development dependencies, run npm install

Style tests

To run ESLint for style testing JavaScript files: npm run lint

Unit tests

We're using vscode-tmgrammar-test for testing the textmate grammar. Test files reside in the /tests directory. These are essentially Cylc workflow files that are annotated with comments. The comments detail what the expected scopes of the test line are. The comments are read in by vscode-tmgrammar-test and compared to the actual applied scopes. An example test might be: ```ini foo = bar

^^^ variable.other.key.cylc

^ keyword.operator.assignment.cylc

^^^ meta.value.cylc string.unquoted.value.cylc

^^^^^^^^^ meta.setting.cylc

``` For docs, follow the link to vscode-tmgrammar-test above.

To run the unit tests: npm test

Owner

  • Name: The Cylc Workflow Engine
  • Login: cylc
  • Kind: organization
  • Email: hilary.oliver@niwa.co.nz
  • Location: Wellington, New Zealand

A workflow engine for cycling systems.

GitHub Events

Total
  • Delete event: 8
  • Push event: 9
  • Pull request review event: 7
  • Pull request event: 19
  • Create event: 10
Last Year
  • Delete event: 8
  • Push event: 9
  • Pull request review event: 7
  • Pull request event: 19
  • Create event: 10

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 128
  • Total Committers: 7
  • Avg Commits per committer: 18.286
  • Development Distribution Score (DDS): 0.367
Past Year
  • Commits: 19
  • Committers: 3
  • Avg Commits per committer: 6.333
  • Development Distribution Score (DDS): 0.263
Top Committers
Name Email Commits
Ronnie Dutta 6****e 81
dependabot[bot] 4****] 26
Tim Pillinger 2****m 7
Oliver Sanders o****s@m****k 5
github-actions[bot] 4****] 4
Bruno Kinoshita k****w@a****g 3
Mark Dawson m****n@m****k 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 14
  • Total pull requests: 59
  • Average time to close issues: 4 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 5
  • Total pull request authors: 6
  • Average comments per issue: 0.29
  • Average comments per pull request: 0.39
  • Merged pull requests: 54
  • Bot issues: 1
  • Bot pull requests: 38
Past Year
  • Issues: 2
  • Pull requests: 17
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 16
  • Bot issues: 1
  • Bot pull requests: 15
Top Authors
Issue Authors
  • MetRonnie (9)
  • oliver-sanders (1)
  • elliotfontaine (1)
  • wxtim (1)
Pull Request Authors
  • dependabot[bot] (43)
  • MetRonnie (18)
  • github-actions[bot] (6)
  • markgrahamdawson (4)
  • oliver-sanders (3)
  • kinow (1)
Top Labels
Issue Labels
bug (5) enhancement (4) duplicate (1)
Pull Request Labels
dependencies (44) infrastructure (6) small (6) enhancement (3) duplicate (1) documentation (1)

Dependencies

package-lock.json npm
  • @eslint/eslintrc 1.2.2 development
  • @humanwhocodes/config-array 0.9.5 development
  • @humanwhocodes/object-schema 1.2.1 development
  • acorn 8.7.1 development
  • acorn-jsx 5.3.2 development
  • ajv 6.12.6 development
  • ansi-regex 5.0.1 development
  • ansi-styles 3.2.1 development
  • ansi-styles 4.3.0 development
  • argparse 2.0.1 development
  • balanced-match 1.0.0 development
  • brace-expansion 1.1.11 development
  • callsites 3.1.0 development
  • chalk 2.4.2 development
  • chalk 4.1.2 development
  • color-convert 1.9.3 development
  • color-convert 2.0.1 development
  • color-name 1.1.3 development
  • color-name 1.1.4 development
  • commander 9.2.0 development
  • concat-map 0.0.1 development
  • cross-spawn 7.0.3 development
  • debug 4.3.4 development
  • deep-is 0.1.4 development
  • diff 4.0.2 development
  • doctrine 3.0.0 development
  • escape-string-regexp 1.0.5 development
  • escape-string-regexp 4.0.0 development
  • eslint 8.14.0 development
  • eslint-scope 7.1.1 development
  • eslint-utils 3.0.0 development
  • eslint-visitor-keys 3.3.0 development
  • eslint-visitor-keys 2.1.0 development
  • espree 9.3.1 development
  • esquery 1.4.0 development
  • esrecurse 4.3.0 development
  • estraverse 5.3.0 development
  • esutils 2.0.3 development
  • fast-deep-equal 3.1.3 development
  • fast-json-stable-stringify 2.1.0 development
  • fast-levenshtein 2.0.6 development
  • file-entry-cache 6.0.1 development
  • flat-cache 3.0.4 development
  • flatted 3.2.5 development
  • fs.realpath 1.0.0 development
  • functional-red-black-tree 1.0.1 development
  • glob 7.1.6 development
  • glob-parent 6.0.2 development
  • globals 13.13.0 development
  • has-flag 4.0.0 development
  • has-flag 3.0.0 development
  • ignore 5.2.0 development
  • import-fresh 3.3.0 development
  • imurmurhash 0.1.4 development
  • inflight 1.0.6 development
  • inherits 2.0.4 development
  • is-extglob 2.1.1 development
  • is-glob 4.0.3 development
  • isexe 2.0.0 development
  • js-yaml 4.1.0 development
  • json-schema-traverse 0.4.1 development
  • json-stable-stringify-without-jsonify 1.0.1 development
  • levn 0.4.1 development
  • lodash.merge 4.6.2 development
  • minimatch 3.0.4 development
  • ms 2.1.2 development
  • natural-compare 1.4.0 development
  • once 1.4.0 development
  • optionator 0.9.1 development
  • parent-module 1.0.1 development
  • path-is-absolute 1.0.1 development
  • path-key 3.1.1 development
  • prelude-ls 1.2.1 development
  • punycode 2.1.1 development
  • regexpp 3.2.0 development
  • resolve-from 4.0.0 development
  • rimraf 3.0.2 development
  • shebang-command 2.0.0 development
  • shebang-regex 3.0.0 development
  • strip-ansi 6.0.1 development
  • strip-json-comments 3.1.1 development
  • supports-color 7.2.0 development
  • supports-color 5.5.0 development
  • text-table 0.2.0 development
  • type-check 0.4.0 development
  • type-fest 0.20.2 development
  • uri-js 4.4.1 development
  • v8-compile-cache 2.1.0 development
  • vscode-oniguruma 1.6.2 development
  • vscode-textmate 7.0.1 development
  • vscode-tmgrammar-test 0.1.1 development
  • which 2.0.2 development
  • word-wrap 1.2.3 development
  • wrappy 1.0.2 development
package.json npm
  • eslint ^8.14.0 development
  • vscode-tmgrammar-test ^0.1.1 development
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/update_copyright.yml actions
  • actions/checkout v3 composite
  • cylc/release-actions/checkout-copyright-branch v1 composite
  • cylc/release-actions/configure-git v1 composite
  • cylc/release-actions/create-pr v1 composite
.github/workflows/shortlog.yml actions
  • actions/checkout v4 composite
  • cylc/release-actions/check-shortlog v1 composite