mirror of
https://github.com/ivuorinen/tree-sitter-shellspec.git
synced 2026-01-26 11:43:59 +00:00
- Add full ShellSpec grammar extending tree-sitter-bash - Support all ShellSpec constructs: Describe, Context, It, hooks, utilities - Include Data block parsing with statements and argument styles - Add 61 comprehensive test cases covering real-world patterns - Implement optimized GitHub workflows with CI/CD automation - Configure complete development tooling (linting, formatting, pre-commit) - Add comprehensive documentation and contribution guidelines - Optimize grammar conflicts to zero warnings - Support editor integration for Neovim, VS Code, Emacs Breaking Changes: - Initial release, no previous API to break BREAKING CHANGE: Initial implementation of tree-sitter-shellspec grammar # Conflicts: # .github/workflows/codeql.yml # .github/workflows/pr-lint.yml # .pre-commit-config.yaml # Conflicts: # .github/workflows/pr-lint.yml # Conflicts: # .github/workflows/pr-lint.yml
220 lines
5.2 KiB
Plaintext
220 lines
5.2 KiB
Plaintext
================================================================================
|
|
BeforeEach hook
|
|
================================================================================
|
|
|
|
BeforeEach
|
|
setup_environment
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
BeforeEach with label
|
|
================================================================================
|
|
|
|
BeforeEach "setup database"
|
|
init_database
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(string
|
|
(string_content))))
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
AfterEach hook
|
|
================================================================================
|
|
|
|
AfterEach
|
|
cleanup_environment
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
AfterEach with label
|
|
================================================================================
|
|
|
|
AfterEach "cleanup database"
|
|
cleanup_database
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(string
|
|
(string_content))))
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
BeforeAll hook
|
|
================================================================================
|
|
|
|
BeforeAll
|
|
global_setup
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
BeforeAll with raw string label
|
|
================================================================================
|
|
|
|
BeforeAll 'global setup'
|
|
global_setup
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(raw_string)))
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
AfterAll hook
|
|
================================================================================
|
|
|
|
AfterAll
|
|
global_cleanup
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
BeforeCall hook
|
|
================================================================================
|
|
|
|
BeforeCall
|
|
prepare_call
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
AfterCall hook
|
|
================================================================================
|
|
|
|
AfterCall
|
|
verify_call
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
BeforeRun hook
|
|
================================================================================
|
|
|
|
BeforeRun
|
|
prepare_run
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
AfterRun hook
|
|
================================================================================
|
|
|
|
AfterRun
|
|
verify_run
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(word)))))
|
|
|
|
================================================================================
|
|
Hook with multiple statements
|
|
================================================================================
|
|
|
|
BeforeEach "complex setup"
|
|
export TEST_VAR="value"
|
|
mkdir -p /tmp/test
|
|
touch /tmp/test/file
|
|
End
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(program
|
|
(shellspec_hook_block
|
|
(command
|
|
name: (command_name
|
|
(string
|
|
(string_content))))
|
|
(declaration_command
|
|
(variable_assignment
|
|
name: (variable_name)
|
|
value: (string
|
|
(string_content))))
|
|
(command
|
|
name: (command_name
|
|
(word))
|
|
argument: (word)
|
|
argument: (word))
|
|
(command
|
|
name: (command_name
|
|
(word))
|
|
argument: (word))))
|