Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svermeulen/tlcheck
Simple command line tool to type check a given teal file/directory
https://github.com/svermeulen/tlcheck
Last synced: about 2 months ago
JSON representation
Simple command line tool to type check a given teal file/directory
- Host: GitHub
- URL: https://github.com/svermeulen/tlcheck
- Owner: svermeulen
- License: mit
- Created: 2022-07-07T02:45:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-03T07:51:12.000Z (about 1 year ago)
- Last Synced: 2024-04-04T13:45:10.048Z (6 months ago)
- Language: Lua
- Size: 36.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Teal Check
A simple command line tool to type check a given [teal](https://github.com/teal-language/tl) file/directory and produce a list of warnings/errors
[![test](https://github.com/svermeulen/tlcheck/actions/workflows/test.yml/badge.svg)](https://github.com/svermeulen/tlcheck/actions/workflows/test.yml)
# Installation
### From luarocks
* `luarocks install tlcheck`
* `tlcheck`### From source
* Clone repo
* From repo root:
* `luarocks init`
* `./luarocks make`
* `./lua_modules/bin/tlcheck`# Usage
```
tlcheck [PATH]
```Note:
* Given path can be a single .tl file or a directory (which will be searched recursively for all .tl files)
* A tlconfig.lua file must be present in the given directory or a parent of the given directory/path
* This program is designed to be more script/machine friendly than human friendly. The output is easy to parse but not easy to read. When no errors are found, there is zero output and the exit code is 0 (and otherwise will be 1)# FAQ
_Doesn't [cyan](https://github.com/teal-language/cyan) already do this?_
Yes. [cyan](https://github.com/teal-language/cyan) would be a better choice when building/type-checking your teal scripts on the command line manually. However, the output from cyan [is not currently very script friendly](https://github.com/teal-language/cyan/issues/21). So `tlcheck` just fills that one particular gap, for cases where you are type checking as part of a larger script/automation/development environment, and would like to parse the errors.
The [tl](https://github.com/teal-language/tl/blob/master/tl) script that comes with teal also provides some of this functionality, however [it appears to be deprecated](https://github.com/teal-language/tl/blob/ce5c741efde0c7417ca443eb268a744e2fd738c4/tl#L253) in favour of cyan.