tarantool / tarantool/doc

Adjust the existing Lua style guide

Open
#1,004 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dev guidelines
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Considering the existing Lua style guide there is no mention for our test naming policy. This led to a little arguing in our patch list.

@Gerold103 claimed that we agreed to the following some time ago:

gh-####-description.test.lua

However, since we backport bugs related to the issues from other queues, the gh-#### prefix is ambigious. Thereby I guess the following pattern is the most convenient one for LuaJIT related tests:

<origin-issue-repo>-####-description.test.lua

Here are some examples:

  • LuaJIT-505-fold-bug-in-string-find.test.lua
  • tarantool-3196-bug-with-zero-hash-strings.test.lua

@kyukhin, @Totktonada, @Gerold103, @kostja, please dump your thoughts related to the naming policy here for the further Lua style guide amending.


Furthermore, all existing tests in LuaJIT suite seem to be written considering the current guideline and violate several practices mentioned by @Totktonada in the review:

  • Use local for variables (tap, test).
  • Use os.exit(test:check() and 0 or 1) at the end.

Please consider applying these comments to the example in out style guide.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the existing Lua style guide's testing section and the linked patch-list discussion first, since the naming policy is still presented as a proposal. Then inspect the LuaJIT suite under test to compare its conventions with the cited review comments. Done means the policy is agreed and the guide's test-naming examples and Lua test practices reflect that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation, testing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.