Skip to content

Commit

Permalink
Merge pull request #47 from jessedoyle/ameba
Browse files Browse the repository at this point in the history
Static Analysis
  • Loading branch information
Jesse Doyle authored Nov 8, 2018
2 parents a67e7f1 + bc763a2 commit 165ee9b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
.build/
src/.build
/doc/
/lib
/bin
/shard.lock
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: crystal
before_install: make libduktape
script: make spec
install:
- shards install
script:
- make spec
- bin/ameba
sudo: false
email: false
email: false
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.15.1 - Nov 7, 2018

- Add [ameba](https://github.com/veelenga/ameba) as a development dependency for static analysis.
- Fix `ameba` lint exceptions consisting of unused variable definitions and block variables.

# v0.15.0 - Aug 14, 2018

- Update Duktape version to `2.3.0`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version: 1.0.0 # your project's version
dependencies:
duktape:
github: jessedoyle/duktape.cr
version: ~> 0.15.0
version: ~> 0.15.1
```
then execute:
Expand Down
7 changes: 6 additions & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: duktape
version: 0.15.0
version: 0.15.1

authors:
- Jesse Doyle <jdoyle@ualberta.ca>

scripts:
postinstall: "make -C ext clean libduktape"

development_dependencies:
ameba:
github: veelenga/ameba
version: 0.8.1

license: MIT
2 changes: 1 addition & 1 deletion spec/duktape/api/heap_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe Duktape do

describe "create_heap" do
it "should create a heap with a custom fatal func" do
heap = Duktape.create_heap do |ctx, msg|
heap = Duktape.create_heap do
num = 3 + 5
raise Exception.new num.to_s
end
Expand Down
2 changes: 1 addition & 1 deletion spec/duktape/api/thread_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe Duktape::API::Thread do
ctx = Duktape::Context.new
ctx.push_global_proc("test") do |ptr|
env = Duktape::Context.new ptr
state = env.suspend
env.suspend
# as the engine is suspended, we should not evaluate 'true'
env.eval("true")
env.get_boolean(-1).should be_false
Expand Down
2 changes: 1 addition & 1 deletion spec/duktape/sandbox_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe Duktape::Sandbox do
context "with timeout" do
it "should raise if timeout < 100" do
expect_raises ArgumentError, /> 100ms/ do
sbx = Duktape::Sandbox.new 99
Duktape::Sandbox.new 99
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/duktape/api/heap.cr
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ module Duktape
end

def self.create_heap_default
create_heap do |udata, msg|
create_heap do |_, msg|
str = String.new msg
raise Duktape::InternalError.new str
end
end

def self.create_heap_udata(udata : Void*)
create_heap(udata) do |udata, msg|
create_heap(udata) do |_, msg|
str = String.new msg
raise Duktape::InternalError.new str
end
Expand Down
2 changes: 1 addition & 1 deletion src/duktape/version.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Duktape
module VERSION
MAJOR = 0
MINOR = 15
TINY = 0
TINY = 1
PRE = nil

STRING = [MAJOR, MINOR, TINY, PRE].compact.join "."
Expand Down

0 comments on commit 165ee9b

Please sign in to comment.