Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mpeterv/luacheck
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.15.1
Choose a base ref
...
head repository: mpeterv/luacheck
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jun 26, 2016

  1. CLI spec: use correct Lua interpreter

    When running CLI tests, use the same interpreter that was used to run
    busted instead of always using `lua`.
    mpeterv committed Jun 26, 2016
    Copy the full SHA
    305f037 View commit details

Commits on Jun 29, 2016

  1. Copy the full SHA
    0da4bca View commit details
  2. CI: use cluacov

    mpeterv committed Jun 29, 2016
    Copy the full SHA
    ef65082 View commit details

Commits on Jul 2, 2016

  1. Copy the full SHA
    d85df51 View commit details
  2. Copy the full SHA
    be2d2f9 View commit details
  3. Recognize mutation with a long key chain

    Previously `x.y = 1` was considered a mutation but `x.y.z = 2` was
    a simple access. Recursively handle indexes in lhs of assignments
    so that such long key chains are recognized as mutations, too.
    mpeterv committed Jul 2, 2016
    Copy the full SHA
    002728c View commit details

Commits on Jul 3, 2016

  1. Copy the full SHA
    a987770 View commit details
  2. Copy the full SHA
    9fcc7c1 View commit details
  3. Copy the full SHA
    e31a156 View commit details

Commits on Jul 5, 2016

  1. Copy the full SHA
    402c6ab View commit details

Commits on Aug 20, 2016

  1. Copy the full SHA
    dd2b9b9 View commit details
  2. Rewrite fs.find_file test to pass on Windows

    Todo: fix underlying issue with fs.split_base that caused
    original version not working ("/" and "\" should be valid anchors
    on Windows).
    mpeterv committed Aug 20, 2016
    Copy the full SHA
    3b40a04 View commit details

Commits on Aug 21, 2016

  1. Copy the full SHA
    bdaced7 View commit details
  2. Normalize directory separator in some expected outputs

    Fixes some more tests on Windows.
    mpeterv committed Aug 21, 2016
    Copy the full SHA
    c060754 View commit details
  3. Copy the full SHA
    55b31bf View commit details
  4. Fix cache tests for Windows

    mpeterv committed Aug 21, 2016
    Copy the full SHA
    e305521 View commit details
  5. Handle \r when reading cache

    Caches are read and written in binary mode (no \r even on Windows).
    However, depending on git settings cache samples may use it anyway.
    
    Fixes remaining tests for Windows.
    mpeterv committed Aug 21, 2016
    Copy the full SHA
    4aeb7bd View commit details

Commits on Sep 16, 2016

  1. Copy the full SHA
    479dcf1 View commit details

Commits on Sep 27, 2016

  1. Copy the full SHA
    a271960 View commit details

Commits on Sep 28, 2016

  1. 0.16.0 release

    mpeterv committed Sep 28, 2016
    Copy the full SHA
    49c3ec2 View commit details
  2. Fix false positive for "variable is mutated but never accessed"

    When value or variable is assigned a result of an operation such as
    "and" or "or", it is externally accessible and mutations of it
    may have an effect even if it is not directly accessed. Same
    if value node tag is Paren (e.g. `local t = (f())`).
    
    Ref #72.
    mpeterv committed Sep 28, 2016
    Copy the full SHA
    1e62378 View commit details
  3. 0.16.1 release

    mpeterv committed Sep 28, 2016
    Copy the full SHA
    48fd788 View commit details

Commits on Oct 25, 2016

  1. Fix event sorting

    A warning and an inline option boundary event can share location
    when a function declaration is unreachable code (a push event is generated
    for each closure start). Previously event comparator assumed that only two
    warnings or two inline option events can share location, resulting in an
    error when this assumption is violated.
    
    The fix is to compare events of different types by set priority before
    falling back to code comparison for warning. Also remove a hack
    that partially worked around this issue by adding `code` field
    to some inline option events.
    
    Ref #74.
    mpeterv committed Oct 25, 2016
    Copy the full SHA
    15890fa View commit details

Commits on Oct 26, 2016

  1. 0.16.2 release

    (Parent commit was tagged as 0.16.2 by mistake)
    mpeterv committed Oct 26, 2016
    Copy the full SHA
    a651b7d View commit details

Commits on Oct 27, 2016

  1. Update README.md [ci skip]

    luacheck supports all LuaJIT versions, not only 2.0.
    mpeterv committed Oct 27, 2016
    Copy the full SHA
    1f6b915 View commit details
  2. 0.16.3 release

    mpeterv committed Oct 27, 2016
    Copy the full SHA
    bce761c View commit details

Commits on Nov 8, 2016

  1. Copy the full SHA
    6377d12 View commit details

Commits on Nov 14, 2016

  1. Add Gitter badge

    gitter-badger committed Nov 14, 2016
    Copy the full SHA
    9c2cdda View commit details
  2. Merge pull request #80 from gitter-badger/gitter-badge

    Add a Gitter chat badge to README.md
    mpeterv authored Nov 14, 2016
    Copy the full SHA
    dc905f4 View commit details

Commits on Nov 15, 2016

  1. Copy the full SHA
    d608a29 View commit details
  2. Copy the full SHA
    25c1c2e View commit details
  3. Fix whitespace issues within LuaCheck itself

    Otherwise LuaCheck would now FAIL its self-test. :D
    
    Note: spec/lexer_spec.lua contains a trailing space that is to be
    kept. Add an "inline" option so that LuaCheck won't complain there.
    n1tehawk committed Nov 15, 2016
    Copy the full SHA
    1b294ad View commit details
  4. Copy the full SHA
    4b1067a View commit details
  5. Copy the full SHA
    6dd3b2c View commit details
  6. Add example file demonstrating whitespace issues

    While at it, fix samples file count for cli_spec.lua accordingly.
    n1tehawk committed Nov 15, 2016
    Copy the full SHA
    2fa5c4c View commit details
  7. Extend spec/cli_spec.lua to analyse spec/samples/bad_whitespace.lua

    This explicitly checks for the expected warnings, and improves code
    coverage during the "busted -c" run.
    n1tehawk committed Nov 15, 2016
    Copy the full SHA
    6172b5f View commit details
  8. Merge pull request #81 from n1tehawk/check_whitespace

    Enable LuaCheck to report common whitespace issues
    mpeterv authored Nov 15, 2016
    Copy the full SHA
    0c6cdc7 View commit details
  9. Copy the full SHA
    e3484ba View commit details
  10. Move an inline option in lexer_spec.lua

    Ignore only one assertion, not the whole block of them.
    mpeterv committed Nov 15, 2016
    Copy the full SHA
    b327a7d View commit details
  11. Bump cache format version

    New warnings were added.
    mpeterv committed Nov 15, 2016
    Copy the full SHA
    32823de View commit details

Commits on Nov 17, 2016

  1. Copy the full SHA
    9baaebd View commit details

Commits on Nov 18, 2016

  1. Whitespace: split into lines using new utils function

    Add a new function `utils.split_lines` that splits
    source into lines using "\n", "\r", "\r\n" and "\n\r"
    as line endings, for consistency with lexer.
    
    Initially it was planned to bring lexer in sync with whitespace
    module instead (using only "\n" and "\r\n" as line ending), however,
    this affects not only line numbers in warnings but also
    parsing string literals, potentially changing their values.
    Keeping in sync with Lua compiler is more important in this case.
    mpeterv committed Nov 18, 2016
    Copy the full SHA
    3a8d724 View commit details
  2. Copy the full SHA
    1af819f View commit details
  3. Refactor message formatting

    Do not assume that all messages use exactly `warning.name`
    `warning.prev_line` in substitutions. Instead, implement a simple
    replacement for string.format that substitutes table fields
    by name and supports highlighting/quoting.
    mpeterv committed Nov 18, 2016
    Copy the full SHA
    e6f91a9 View commit details
  4. Don't assign name field to warnings that can't be filtered by it

    Instead, use `field` for unused field/index warnings and
    use `label` for unused label warnings. Adjust message templates.
    Simplify condition under which a warning can't be filtered
    by name to `not warning.name`.
    mpeterv committed Nov 18, 2016
    Copy the full SHA
    3f0fa5e View commit details
  5. Copy the full SHA
    1aa3239 View commit details
  6. Copy the full SHA
    1ea652a View commit details
  7. Add CHANGELOG.md [ci skip]

    Release descriptions on GitHub don't seem to be a part of the repo.
    Migrate them into a file.
    mpeterv committed Nov 18, 2016
    Copy the full SHA
    d9683c1 View commit details
  8. 0.17.0 release

    mpeterv committed Nov 18, 2016
    Copy the full SHA
    51d3b72 View commit details

Commits on Nov 19, 2016

  1. Copy the full SHA
    9cd95a3 View commit details
Showing with 13,134 additions and 6,387 deletions.
  1. +5 −0 .busted
  2. +10 −1 .gitignore
  3. +3 −2 .luacheckrc
  4. +25 −28 .travis.yml
  5. +632 −0 CHANGELOG.md
  6. +2 −2 LICENSE
  7. +29 −24 README.md
  8. +17 −5 appveyor.yml
  9. +94 −0 build/Makefile
  10. +7 −0 build/bin/luacheck.lua
  11. +53 −19 docsrc/cli.rst
  12. +3 −3 docsrc/conf.py
  13. +132 −54 docsrc/config.rst
  14. +1 −1 docsrc/index.rst
  15. +31 −26 docsrc/inline.rst
  16. +18 −10 docsrc/module.rst
  17. +148 −22 docsrc/warnings.rst
  18. +0 −131 install.lua
  19. +82 −0 luacheck-dev-1.rockspec
  20. +0 −50 luacheck-scm-1.rockspec
  21. +32 −0 scripts/build-binaries.sh
  22. +67 −0 scripts/dedicated_coverage.sh
  23. +18 −0 scripts/gen_unicode_printability_module.sh
  24. +39 −0 scripts/package.sh
  25. +86 −0 scripts/unicode_data_to_printability_module.lua
  26. +74 −0 spec/bad_whitespace_spec.lua
  27. +67 −181 spec/cache_spec.lua
  28. +0 −4 spec/caches/bad_lines.cache
  29. +0 −5 spec/caches/bad_mtime.cache
  30. +0 −5 spec/caches/bad_result.cache
  31. +0 −5 spec/caches/bad_result2.cache
  32. +0 −5 spec/caches/different_format.cache
  33. +0 −3 spec/caches/old_format.cache
  34. +177 −506 spec/check_spec.lua
  35. +461 −232 spec/cli_spec.lua
  36. +124 −50 spec/config_spec.lua
  37. +9 −0 spec/configs/bad_custom_std_config.luacheckrc
  38. +23 −0 spec/configs/custom_fields_config.luacheckrc
  39. +2 −2 spec/configs/custom_stds_config.luacheckrc
  40. +3 −0 spec/configs/format_opts_config.luacheckrc
  41. +4 −0 spec/configs/paths_config.luacheckrc
  42. +236 −0 spec/cyclomatic_complexity_spec.lua
  43. +92 −0 spec/decoder_spec.lua
  44. +68 −0 spec/empty_blocks_spec.lua
  45. +16 −0 spec/expand_rockspec_spec.lua
  46. +102 −5 spec/filter_spec.lua
  47. +2 −1 spec/format_spec.lua
  48. +13 −10 spec/fs_spec.lua
  49. +143 −0 spec/globals_spec.lua
  50. +42 −33 spec/globbing_spec.lua
  51. +48 −4 spec/helper.lua
  52. +140 −102 spec/lexer_spec.lua
  53. +26 −38 spec/linearize_spec.lua
  54. +114 −28 spec/luacheck_spec.lua
  55. +98 −34 spec/options_spec.lua
  56. +916 −454 spec/parser_spec.lua
  57. +14 −0 spec/projects/default_stds/.luacheckrc
  58. +13 −0 spec/projects/default_stds/default_stds-scm-1.rockspec
  59. +2 −0 spec/projects/default_stds/nested/spec/sample_spec.lua
  60. +2 −0 spec/projects/default_stds/normal_file.lua
  61. +1 −0 spec/projects/default_stds/sample_spec.lua
  62. +1 −0 spec/projects/default_stds/test/nested_normal_file.lua
  63. +1 −0 spec/projects/default_stds/test/sample_spec.lua
  64. +1 −0 spec/projects/default_stds/tests/nested/sample_spec.lua
  65. +1 −0 spec/projects/default_stds/tests/sample_spec.lua
  66. +8 −39 spec/{analyze_spec.lua → resolve_locals_spec.lua}
  67. +87 −0 spec/reversed_fornum_loops_spec.lua
  68. +1 −0 spec/rock/bin/rock.lua
  69. +1 −0 spec/rock/bin/rock.sh
  70. +1 −0 spec/rock/lua_modules/something.lua
  71. +18 −0 spec/rock/rock-dev-1.rockspec
  72. +1 −0 spec/rock/src/rock.lua
  73. +1 −0 spec/rock/src/rock/mod.lua
  74. +1 −0 spec/rock/src/rock/thing.c
  75. +1 −0 spec/rock/test.lua
  76. +1 −0 spec/rock2/mod.lua
  77. +19 −0 spec/rock2/rock2-dev-1.rockspec
  78. +1 −0 spec/rock2/spec/rock2_spec.lua
  79. 0 spec/samples/{argparse.lua → argparse-0.2.0.lua}
  80. +1 −1 spec/samples/bad.rockspec
  81. +44 −0 spec/samples/bad_whitespace.lua
  82. +42 −0 spec/samples/global_fields.lua
  83. +5 −0 spec/samples/indirect_globals.lua
  84. +30 −0 spec/samples/line_length.lua
  85. +2 −0 spec/samples/redefined.lua
  86. +3 −0 spec/samples/reversed_fornum.lua
  87. +2 −1 spec/samples/sample.rockspec
  88. +8 −0 spec/samples/utf8.lua
  89. +2 −0 spec/samples/utf8_error.lua
  90. +92 −0 spec/serializer_spec.lua
  91. +290 −0 spec/standards_spec.lua
  92. +56 −0 spec/unbalanced_assignments_spec.lua
  93. +125 −0 spec/uninit_accesses_spec.lua
  94. +126 −0 spec/unreachable_code_spec.lua
  95. +46 −0 spec/unused_fields_spec.lua
  96. +372 −0 spec/unused_locals_spec.lua
  97. +39 −19 spec/utils_spec.lua
  98. +0 −319 src/luacheck/analyze.lua
  99. +0 −1,173 src/luacheck/argparse.lua
  100. +301 −0 src/luacheck/builtin_standards/init.lua
  101. +137 −0 src/luacheck/builtin_standards/love.lua
  102. +152 −0 src/luacheck/builtin_standards/ngx.lua
  103. +80 −269 src/luacheck/cache.lua
  104. +71 −201 src/luacheck/check.lua
  105. +66 −0 src/luacheck/check_state.lua
  106. +410 −149 src/luacheck/config.lua
  107. +78 −56 src/luacheck/core_utils.lua
  108. +199 −0 src/luacheck/decoder.lua
  109. +72 −18 src/luacheck/expand_rockspec.lua
  110. +434 −176 src/luacheck/filter.lua
  111. +72 −90 src/luacheck/format.lua
  112. +86 −77 src/luacheck/fs.lua
  113. +3 −6 src/luacheck/globbing.lua
  114. +30 −28 src/luacheck/init.lua
  115. +0 −315 src/luacheck/inline_options.lua
  116. +116 −95 src/luacheck/lexer.lua
  117. +270 −456 src/luacheck/main.lua
  118. +26 −19 src/luacheck/multithreading.lua
  119. +191 −91 src/luacheck/options.lua
  120. +592 −332 src/luacheck/parser.lua
  121. +149 −0 src/luacheck/profiler.lua
  122. +0 −46 src/luacheck/reachability.lua
  123. +415 −0 src/luacheck/runner.lua
  124. +211 −0 src/luacheck/serializer.lua
  125. +76 −0 src/luacheck/stages/detect_bad_whitespace.lua
  126. +159 −0 src/luacheck/stages/detect_cyclomatic_complexity.lua
  127. +36 −0 src/luacheck/stages/detect_empty_blocks.lua
  128. +13 −0 src/luacheck/stages/detect_empty_statements.lua
  129. +252 −0 src/luacheck/stages/detect_globals.lua
  130. +39 −0 src/luacheck/stages/detect_reversed_fornum_loops.lua
  131. +34 −0 src/luacheck/stages/detect_unbalanced_assignments.lua
  132. +54 −0 src/luacheck/stages/detect_uninit_accesses.lua
  133. +36 −0 src/luacheck/stages/detect_unreachable_code.lua
  134. +81 −0 src/luacheck/stages/detect_unused_fields.lua
  135. +330 −0 src/luacheck/stages/detect_unused_locals.lua
  136. +75 −0 src/luacheck/stages/init.lua
  137. +194 −177 src/luacheck/{ → stages}/linearize.lua
  138. +71 −0 src/luacheck/stages/name_functions.lua
  139. +19 −0 src/luacheck/stages/parse.lua
  140. +351 −0 src/luacheck/stages/parse_inline_options.lua
  141. +216 −0 src/luacheck/stages/resolve_locals.lua
  142. +52 −0 src/luacheck/stages/unwrap_parens.lua
  143. +269 −0 src/luacheck/standards.lua
  144. +0 −105 src/luacheck/stds.lua
  145. +36 −0 src/luacheck/unicode.lua
  146. +2 −0 src/luacheck/unicode_printability_boundaries.lua
  147. +115 −37 src/luacheck/utils.lua
  148. +21 −0 src/luacheck/vendor/sha1/LICENSE
  149. +24 −0 src/luacheck/vendor/sha1/bit32_ops.lua
  150. +24 −0 src/luacheck/vendor/sha1/bit_ops.lua
  151. +20 −0 src/luacheck/vendor/sha1/common.lua
  152. +195 −0 src/luacheck/vendor/sha1/init.lua
  153. +29 −0 src/luacheck/vendor/sha1/lua53_ops.lua
  154. +144 −0 src/luacheck/vendor/sha1/pure_lua_ops.lua
  155. +10 −7 src/luacheck/version.lua
5 changes: 5 additions & 0 deletions .busted
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
return {
_all = {
["exclude-pattern"] = "sample_spec"
}
}
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
bin/luacheck
.luacheckcache
luacov.stats.out
luacov.report.out
doc
!build/
build/*
!build/Makefile
!build/bin
build/bin/*
!build/bin/luacheck.lua
package
scripts/UnicodeData-*
docsrc/.doctrees
5 changes: 3 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
std = "min"
cache = true
exclude_files = {"spec/*/*"}
include_files = {"src", "spec/*.lua", "scripts/*.lua", "*.rockspec", "*.luacheckrc"}
exclude_files = {"src/luacheck/vendor"}

files["spec/*_spec.lua"].std = "+busted"
files["src/luacheck/unicode_printability_boundaries.lua"].max_line_length = false
53 changes: 25 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
language: c
language: python
sudo: false

cache:
directories: here
env:
- LUA="lua=5.1"
- LUA="lua=5.2"
- LUA="lua=5.3"
- LUA="luajit=2.0"
- LUA="luajit=2.1"

matrix:
include:
- compiler: ": Lua51"
env: LUA="lua 5.1"
- compiler: ": Lua52"
env: LUA="lua 5.2"
- compiler: ": Lua53"
env: LUA="lua 5.3"
- compiler: ": LuaJIT20"
env: LUA="luajit 2.0"
- compiler: ": LuaJIT21"
env: LUA="luajit 2.1"
before_install:
- pip install hererocks
- pip install codecov
- hererocks here --$LUA -r latest
- source here/bin/activate
- luarocks install lanes
- luarocks install busted
- luarocks install cluacov
- luarocks install luautf8
- luarocks install luasocket

install:
- wget https://raw.githubusercontent.com/mpeterv/hererocks/latest/hererocks.py
- python hererocks.py here --$LUA -r https://github.com/mpeterv/luarocks@upgrade-install
- export PATH=$PATH:$PWD/here/bin
- luarocks install lanes --upgrade --upgrade-deps
- luarocks install busted --upgrade --upgrade-deps
- luarocks install luacov-coveralls --upgrade --upgrade-deps
- luarocks make

script:
- busted -c
- lua -e 'package.path="./src/?.lua;./src/?/init.lua;"..package.path' -lluacov bin/luacheck.lua luacheck-scm-1.rockspec -j2
- lua -e 'package.preload.lfs=error;package.path="./src/?.lua;./src/?/init.lua;"..package.path' -lluacov bin/luacheck.lua spec | grep 'I/O error'
- lua -e 'package.path="./src/?.lua;./src/?/init.lua;"..package.path' -lluacov bin/luacheck.lua luacheck-dev-1.rockspec -j2
- lua -e 'package.preload.lanes=error;package.path="./src/?.lua;./src/?/init.lua;"..package.path' -lluacov bin/luacheck.lua --version | grep 'Not found'
- lua install.lua path/to/luacheck
- mv src src2
- path/to/luacheck/bin/luacheck spec/*.lua
- mv src2 src
- lua -e 'package.path="./src/?.lua;./src/?/init.lua;"..package.path' -lluacov bin/luacheck.lua spec/*.lua
- luacheck .
- luacheck .

after_success: luacov-coveralls -v
after_script:
- luacov
- codecov -f luacov.report.out -X gcov
Loading