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

Add support for matrix blocks #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mplough
Copy link
Contributor

@mplough mplough commented Jan 30, 2021

This PR adds support for matrix blocks, including the optional excludes section. It also adds highlighting for built-in parameter types and makes several tweaks, as explained in inline PR comments.

syn keyword jenkinsfileCoreStep scm
syn keyword jenkinsfileCoreStep sh
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sh step is already a jenkinsfilePipelineStep below. It's better suited there so this conflicting definition is removed.

Comment on lines -15 to +16
syn keyword jenkinsfileCoreStep docker dockerfile skipwhite nextgroup=jenkinsFileDockerConfigBlock
syn keyword jenkinsfileCoreStep docker dockerfile skipwhite nextgroup=jenkinsfileDockerConfigBlock
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In several places I've made the case consistent, changing jenkinsFile to jenkinsfile.

Comment on lines -28 to +36
syn region jenkinsFileDockerConfigBlock contained start='{' end='}' contains=groovyString,jenkinsfileDockerKeyword transparent
syn keyword jenkinsFileDockerKeyword contained image args additionalBuildArgs label registryUrl registryCredentialsId alwaysPull filename dir
syn region jenkinsfileAxisConfigBlock contained start='{' end='}' contains=groovyString,groovyComment,groovyLineComment,jenkinsfileAxisKeyword transparent
syn keyword jenkinsfileAxisKeyword contained name notValues values

syn region jenkinsfileDockerConfigBlock contained start='{' end='}' contains=groovyString,groovyComment,groovyLineComment,jenkinsfileDockerKeyword transparent
syn keyword jenkinsfileDockerKeyword contained image args additionalBuildArgs label registryUrl registryCredentialsId reuseNode alwaysPull filename dir

syn region jenkinsfileParametersConfigBlock contained start='{' end='}' contains=groovyString,groovyComment,groovyLineComment,jenkinsfileParametersKeyword transparent
syn keyword jenkinsfileParametersKeyword contained string text booleanParam choice password
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of these config blocks can now contain both line and block comments.

Comment on lines -79 to +86
syn keyword jenkinsfilePipelineStep nexusArtifactUploader nexusPolicyEvaluation nexusPublisher node nodejs nodesByLabel
syn keyword jenkinsfilePipelineStep nexusArtifactUploader nexusPolicyEvaluation nexusPublisher nodejs nodesByLabel
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a judgment call. Jenkins pipeline documentation seems to give special treatment to the node step, so it stays a jenkinsfileCoreStep above.

Comment on lines -101 to +109
syn keyword jenkinsfilePipelineStep splitTests springBoot sscm sseBuild sseBuildAndPublish sshPublisher sshagent stage
syn keyword jenkinsfilePipelineStep startET startSandbox startSession startTS stash step stepcounter stopET stopSandbox
syn keyword jenkinsfilePipelineStep splitTests springBoot sscm sseBuild sseBuildAndPublish sshPublisher sshagent
syn keyword jenkinsfilePipelineStep startET startSandbox startSession startTS stash stepcounter stopET stopSandbox
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar to node, stage and step also stay only as jenkinsfileCoreSteps, above.

Comment on lines -106 to +113
syn keyword jenkinsfilePipelineStep timeout timestamps tm tool touch triggerInputStep triggerJob typetalkSend uftScenarioLoad
syn keyword jenkinsfilePipelineStep timeout timestamps tm touch triggerInputStep triggerJob typetalkSend uftScenarioLoad
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tool is also a jenkinsfileDirective. This conflicting definition is removed.

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.

1 participant