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

docs(reference): describe restrictions of a variable name #4411

Merged
merged 1 commit into from Apr 30, 2020

Conversation

saig0
Copy link
Member

@saig0 saig0 commented Apr 29, 2020

Description

  • avoid that users use an invalid name for a variable by describing how a variable name should look like

Related issues

none

Pull Request Checklist

  • All commit messages match our commit message guidelines
  • The submitting code follows our code style
  • If submitting code, please run mvn clean install -DskipTests locally before committing

@saig0 saig0 requested a review from korthout April 29, 2020 08:59
Copy link
Member

@korthout korthout left a comment

Choose a reason for hiding this comment

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

Great addition. I've only got some small notes.

* it must not start with a number
* it must not contain whitespaces
* it must not contain an operator (e.g. `+`, `-`, `*`, `/`, `=`, `>`, `?`, `.`)
* it must not be a literal (`null`, `true`, `false`) or a keyword (e.g. `function`, `if`, `then`, `else`, `for`, `between`, `instance`, `of`, `not`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* it must not be a literal (`null`, `true`, `false`) or a keyword (e.g. `function`, `if`, `then`, `else`, `for`, `between`, `instance`, `of`, `not`)
* it must not be a literal (e.g. `null`, `true`, `false`) or a keyword (e.g. `function`, `if`, `then`, `else`, `for`, `between`, `instance`, `of`, `not`)

* it must not start with a number
* it must not contain whitespaces
* it must not contain an operator (e.g. `+`, `-`, `*`, `/`, `=`, `>`, `?`, `.`)
* it must not be a literal (`null`, `true`, `false`) or a keyword (e.g. `function`, `if`, `then`, `else`, `for`, `between`, `instance`, `of`, `not`)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not entirely sure, but I'm wondering whether it may not contain x is better for these restrictions.

@@ -2,6 +2,18 @@

Variables are part of a workflow instance and represent the data of the instance. A variable has a name and a JSON value. The visibility of a variable is defined by its variable scope.

## Variable Names

The name of a variable can be any alphanumeric string including the `_` symbol. For a combination of words, it is recommended to use the `camelCase` or the `snake_case` format.
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should additionally note here that kebab-case cannot be used, because it might be a common pitfall.

@saig0
Copy link
Member Author

saig0 commented Apr 30, 2020

@korthout , thank you for the fast review and the hints 👍

@saig0
Copy link
Member Author

saig0 commented Apr 30, 2020

bors r+

zeebe-bors bot added a commit that referenced this pull request Apr 30, 2020
4411: docs(reference): describe restrictions of a variable name r=saig0 a=saig0

## Description

* avoid that users use an invalid name for a variable by describing how a variable name should look like

## Related issues

none

#

Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
@zeebe-bors
Copy link
Contributor

zeebe-bors bot commented Apr 30, 2020

Build failed

@saig0
Copy link
Member Author

saig0 commented Apr 30, 2020

bors retry

@zeebe-bors
Copy link
Contributor

zeebe-bors bot commented Apr 30, 2020

Build succeeded

@zeebe-bors zeebe-bors bot merged commit 9e3fda8 into develop Apr 30, 2020
@zeebe-bors zeebe-bors bot deleted the docs-variable-name branch April 30, 2020 06:59
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.

None yet

3 participants