Skip to content

Commit

Permalink
Merge tag 'v1.2.0' into fields
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Aug 29, 2024
2 parents ef20234 + cc089e3 commit 3340ea4
Show file tree
Hide file tree
Showing 50 changed files with 1,902 additions and 121 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/busted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ jobs:
strategy:
fail-fast: false
matrix:
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ]
runs-on: ubuntu-20.04
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit" ] # , "luajit-openresty"
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup ‘lua’
uses: leafo/gh-actions-lua@v9
with:
luaVersion: ${{ matrix.luaVersion }}

- name: Setup ‘luarocks’
uses: leafo/gh-actions-luarocks@v4

- name: Setup dependencies
run: |
luarocks install --deps-only luacheck-dev-1.rockspec
Expand All @@ -27,8 +30,10 @@ jobs:
luarocks install luautf8 # required for decoder unit test
luarocks install luasocket # required for profiler unit test
luarocks install luacov-coveralls
- name: Run busted test suite
- name: Run regression tests
run: busted -c -v

- name: Report test coverage
if: success()
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
github.repository == 'lunarmodules/luacheck' &&
( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') )
}}
uses: ./.github/workflows/docker.yml
uses: lunarmodules/.github/.github/workflows/docker_ghcr_deploy.yml@main
with:
username: ${{ github.actor }}
tag: ${{ github.ref_name }}
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/docker.yml

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@ jobs:
strategy:
fail-fast: false
matrix:
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ]
runs-on: ubuntu-20.04
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit" ] # , "luajit-openresty"
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup ‘lua’
uses: leafo/gh-actions-lua@v9
with:
luaVersion: ${{ matrix.luaVersion }}

- name: Setup ‘luarocks’
uses: leafo/gh-actions-luarocks@v4

- name: Setup dependencies
run: |
luarocks install --deps-only luacheck-dev-1.rockspec
- name: Build ‘luacheck’ (bootstrap)
run: luarocks make

- name: Run ‘luacheck’ (dogfood)
run: luacheck .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
luacov.stats.out
luacov.report.out
doc
*.rock
!build/
build/*
!build/Makefile
Expand Down
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,64 @@

All notable changes to this project will be documented in this file.

## [1.2.0] - 2024-05-24

### Features

- Add builtin standards support for minetest (#108) — @BuckarooBanzay and @appgurueu

### Performance

- Memoize results to addresses speed refression from new feature in v0.26 (#105) — @tomlau10

## [1.1.2] - 2023-12-08

### Features

- Support NO_COLOR environment variable (#102) — @ligurio

### Bug Fixes

- Update SILE builtin with more allowed variables — @alerque

## [1.1.1] - 2023-06-09

### Features

- Update Löve standard to 11.4 (#95) — @RunningDroid
- Documentation improvements (#92 and #89) — @rcloran and @hramrach

### Bug Fixes

- Correct compound operators to not crash on modifying upvalues (#96) — @arichard4
- Fix warning 582 (error prone negation) not applying to subexpressions (#94) — @appgurueu

## [1.1.0] - 2022-12-19

### Features

- Add builtin rule set for SILE globals (#79) — @alerque
- Implement support for compound operators (#66) — @a2 & @arichard4

### Bug Fixes

- Correct circular reference detection visavis OpSet — @arichard4
- Remove unnecessary symbol from Playdate std (#84) — @DidierMalenfant

## v1.0.0 (2022-08-24)

### Documentation

- [**breaking**] Follow semver guidelines, next release will be v1.x.y

### Features

- Overhaul docker container to run on Lua 5.4 — @alerque
- Store cached luacheck values per-version in case of changes — @arichard4
- Set_default_std for ldoc — @Aire-One
- Add builtin std option for Ldoc globals — @Aire-One
- Add builtin std option for the Playdate SDK — @DidierMalenfant

## v0.26.1 (2022-04-23)

### Bug Fixes
Expand Down
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#syntax=docker/dockerfile:1.2

FROM alpine:edge AS luacheck
FROM akorn/luarocks:lua5.4-alpine AS builder

RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
dumb-init gcc libc-dev

COPY ./ /src
WORKDIR /src

RUN luarocks --tree /pkgdir/usr/local make
RUN find /pkgdir -type f -exec sed -i -e 's!/pkgdir!!g' {} \;

FROM akorn/lua:5.4-alpine AS final

RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
dumb-init

LABEL org.opencontainers.image.title="Luacheck"
LABEL org.opencontainers.image.description="A containerized version of Luacheck, a tool for linting and static analysis of Lua code"
Expand All @@ -9,10 +23,8 @@ LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.url="https://github.com/lunarmodules/luacheck/pkgs/container/luacheck"
LABEL org.opencontainers.image.source="https://github.com/lunarmodules/luacheck"

RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing dumb-init lua lua-argparse lua-filesystem lua-lanes

COPY "src/luacheck/" "/usr/share/lua/5.1/luacheck/"
COPY "bin/luacheck.lua" "/usr/bin/luacheck"
COPY --from=builder /pkgdir /
RUN luacheck --version

WORKDIR /data

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![Join the chat at https://gitter.im/luacheck/Lobby](https://badges.gitter.im/luacheck/Lobby.svg)](https://gitter.im/luacheck/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Luacheck](https://img.shields.io/github/workflow/status/lunarmodules/luacheck/Luacheck?label=Luacheck&logo=Lua)](https://github.com/lunarmodules/luacheck/actions?workflow=Luacheck)
[![Busted](https://img.shields.io/github/workflow/status/lunarmodules/luacheck/Busted?label=Busted&logo=Lua)](https://github.com/lunarmodules/luacheck/actions?workflow=Busted)
[![Luacheck](https://img.shields.io/github/actions/workflow/status/lunarmodules/luacheck/luacheck.yml?branch=master&label=Luacheck&logo=Lua)](https://github.com/lunarmodules/luacheck/actions?workflow=Luacheck)
[![Busted](https://img.shields.io/github/actions/workflow/status/lunarmodules/luacheck/busted.yml?branch=master&label=Busted&logo=Lua)](https://github.com/lunarmodules/luacheck/actions?workflow=Busted)
[![Coverage Status](https://img.shields.io/coveralls/github/lunarmodules/luacheck?label=Coveralls&logo=Coveralls)](https://coveralls.io/github/lunarmodules/luacheck?branch=master)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/lunarmodules/luacheck?label=Tag&logo=GitHub)](https://github.com/lunarmodules/luacheck/releases)
[![Luarocks](https://img.shields.io/luarocks/v/lunarmodules/luacheck?label=Luarocks&logo=Lua)](https://luarocks.org/modules/lunarmodules/luacheck)
Expand Down Expand Up @@ -40,7 +40,7 @@ For parallel checking Luacheck additionally requires [LuaLanes](https://github.c
### Windows binary download

For Windows there is single-file 64-bit binary distribution, bundling Lua 5.4.4, Luacheck, LuaFileSystem, and LuaLanes using [LuaStatic](https://github.com/ers35/luastatic):
[download](https://github.com/lunarmodules/luacheck/releases/download/0.26.1/luacheck.exe).
[download](https://github.com/lunarmodules/luacheck/releases/download/v1.2.0/luacheck.exe).

## Basic usage

Expand Down Expand Up @@ -109,13 +109,13 @@ Documentation can be built using [Sphinx](http://sphinx-doc.org/): `sphinx-build

## Development

Luacheck is currently in development. The latest released version is 0.26.1. The interface of the `luacheck` module may change between minor releases. The command line interface is fairly stable.
Luacheck is currently in development. The latest released version is v1.2.0. The interface of the `luacheck` module may change between minor releases. The command line interface is fairly stable.

Use the Luacheck issue tracker on GitHub to submit bugs, suggestions and questions. Any pull requests are welcome, too.

## Building and testing

After the Luacheck repo is cloned and changes are made, run `luarocks make` (using `sudo` if necessary) from its root directory to install dev version of Luacheck. To run Luacheck using sources in current directory without installing it, run `lua -e 'package.path="./src/?.lua;./src/?/init.lua;"..package.path' bin/luacheck.lua ...`. To test Luacheck, ensure that you have [busted](http://olivinelabs.com/busted/) and [luautf8](https://github.com/starwing/luautf8) installed and run `busted`.
After the Luacheck repo is cloned and changes are made, run `luarocks make` (using `sudo` if necessary) from its root directory to install dev version of Luacheck. To run Luacheck using sources in current directory without installing it, run `lua -e 'package.path="./src/?.lua;./src/?/init.lua;"..package.path' bin/luacheck.lua ...`. To test Luacheck, ensure that you have [busted](http://olivinelabs.com/busted/), [luautf8](https://github.com/starwing/luautf8), and [luasocket](https://github.com/lunarmodules/luasocket) installed and run `busted`.

## Docker

Expand Down Expand Up @@ -172,14 +172,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Luacheck linter
uses: lunarmodules/luacheck@v0
uses: lunarmodules/luacheck@v1
```
By default the GH Action is configured to run `luacheck .`, but you can also pass it your own `args` to replace the default input of `.`.

```yaml
- name: Luacheck linter
uses: lunarmodules/luacheck@v0
uses: lunarmodules/luacheck@v1
with:
args: myfile.lua
```
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
default: "."
runs:
using: docker
image: docker://ghcr.io/lunarmodules/luacheck:v0.26.1
image: docker://ghcr.io/lunarmodules/luacheck:v1.2.0
entrypoint: sh
args:
- -c
Expand Down
19 changes: 19 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[git]
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc.*!:", group = "Documentation", skip = false },
{ message = "^doc", group = "Documentation", skip = true },
{ message = "^perf", group = "Performance" },
{ message = "^refactor.*!:", group = "Refactor", skip = false },
{ message = "^refactor", group = "Refactor", skip = true },
{ message = "^style", group = "Styling", skip = true },
{ message = "^test", group = "Testing", skip = true },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore.*!:", group = "Miscellaneous Tasks", skip = false },
{ message = "^chore", group = "Miscellaneous Tasks", skip = true },
{ body = ".*security", group = "Security"},
]
filter_commits = true
tag_pattern = "v[0-9]*"
sort_commits = "newest"
3 changes: 3 additions & 0 deletions docsrc/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Option Meaning
* ``busted`` - globals added by Busted 2.0, by default added for files ending with ``_spec.lua`` within ``spec``, ``test``, and ``tests`` subdirectories;
* ``rockspec`` - globals allowed in rockspecs, by default added for files ending with ``.rockspec``;
* ``luacheckrc`` - globals allowed in Luacheck configs, by default added for files ending with ``.luacheckrc``;
* ``ldoc`` - globals allowed in LDoc config, by default added for files named ``config.ld``;
* ``sile`` - globals allowed in The SILE Typesetter and its package ecosystem;
* ``none`` - no standard globals.

See :ref:`stds`
Expand Down Expand Up @@ -117,6 +119,7 @@ Option Meaning
``--ignore | -i <patt> [<patt>] ...`` Filter out warnings matching patterns.
``--enable | -e <patt> [<patt>] ...`` Do not filter out warnings matching patterns.
``--only | -o <patt> [<patt>] ...`` Filter out warnings not matching patterns.
``--operators <patt> [<patt>] ...`` Allow compound operators matching patterns. (Multiple assignment not supported, as this is specifically for the Playdate SDK.)
``--config <config>`` Path to custom configuration file (default: ``.luacheckrc``).
``--no-config`` Do not look up custom configuration file.
``--default-config <config>`` Default path to custom configuration file, to be used if ``--[no-]config`` is not used and ``.luacheckrc`` is not found.
Expand Down
4 changes: 2 additions & 2 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '0.26.1'
version = '1.2.0'
# The full version, including alpha/beta/rc tags.
release = '0.26.1'
release = '1.2.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 4 additions & 0 deletions docsrc/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Option Type Default v
``read_globals`` Array of strings or field definition map ``{}``
``new_read_globals`` Array of strings or field definition map (Do not overwrite)
``not_globals`` Array of strings ``{}``
``operators`` Array of strings ``{}``
``compat`` Boolean ``false``
``allow_defined`` Boolean ``false``
``allow_defined_top`` Boolean ``false``
Expand Down Expand Up @@ -191,5 +192,8 @@ Default per-path std overrides
files["**/tests/**/*_spec.lua"].std = "+busted"
files["**/*.rockspec"].std = "+rockspec"
files["**/*.luacheckrc"].std = "+luacheckrc"
files["**/config.ld"].std = "+ldoc"
These are added to the global ``std`` specified in the config file.
Each of these can be overriden by setting a different ``std`` value for the corresponding key in ``files``.
Setting ``std`` on the commandline removes these default overrides.
2 changes: 1 addition & 1 deletion docsrc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Contents:
inline
module

This is documentation for 0.26.0 version of `Luacheck <https://github.com/lunarmodules/luacheck/>`_, a linter for `Lua <https://www.lua.org/>`_.
This is documentation for version |version| of `Luacheck <https://github.com/lunarmodules/luacheck/>`_, a linter for `Lua <https://www.lua.org/>`_.
1 change: 1 addition & 0 deletions docsrc/warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Code Description
021 An invalid inline option.
022 An unpaired inline push directive.
023 An unpaired inline pop directive.
033 Invalid use of a compound operator. (Lua doesn't support compound operator by default; if using an extension that does, please set the operators option.)
111 Setting an undefined global variable.
112 Mutating an undefined global variable.
113 Accessing an undefined global variable.
Expand Down
Loading

0 comments on commit 3340ea4

Please sign in to comment.