nasl-pedant 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzAxNGZlNTBhZWE1ODNkNTYyNjgxZmYxM2Y2NGNkYTgyMjhjMDY0ZQ==
4
+ NGNlMmFiYThiNDA5OGE3MmUyZDcwMTM3ZGMxODdhN2ZlYzliMDQzNQ==
5
5
  data.tar.gz: !binary |-
6
- ODlhZTc4MGMxMjdlZGYzYzBiYWY4NDYzMzUzNGNmMGNlODU2ZDhlOQ==
6
+ MTY1NDYwOTM2NTQ3ZDZlZGFjNjVlODY4YTUzY2QzMmZkYzRkN2ExMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2E5MGRlNzE4MTk0ZWM1ODU2NTMwYWVlZTRlYjEwMDBjMDViM2ZjMjhiMTJh
10
- YTQzYTRhODE1NTQwNzJhOWI2ZWY5MzUxZjJkNmZkMjQwNTZkOTc5ODMwZDE4
11
- ZTYwMzUzOGE2ZTI5ODE3YTg1NmIzMjc1MGMzNzZkMjBlYTQzMzc=
9
+ YWYyMjg0MjExZTIyMzliNjQ5MzI1YWRjOWZhNDdlNjhiMjA3ZTUxNDE4OThh
10
+ ODIxM2QxODk5MThkODI5YWY0NGM2Njg1OWI3ZTkyOGRjNDY3YmU0NjA4YmI1
11
+ ZWQwMGRkNmI0ODI4ZTA0ZDlmMTNlMTk4MTcyNGRiMTdkM2JjNTM=
12
12
  data.tar.gz: !binary |-
13
- ZGE5MDdjNGNmMjk0ZjI2YWVkNzViY2U2MzU4MGQ4NTdkN2YyNjk0OWJmYzE0
14
- N2ZjOWY0ZTVhZDgxOGRlYmFkNmJiN2Y4MDMwMjY1MjM3YmVlMDI1ZmUxOTE0
15
- MzA5MjkzMTM3YjlmZDUzN2Q5MTNlOWE3N2FjMzI2NzFhOGZhYmY=
13
+ ZGM1ZjYxZGUwMWE4M2I0ODQ5NGUyODFlNGM0NTc3ODZjMGE1NTAzYTQ1Nzgz
14
+ MDg2MWYzZDk3OGY1YWUxOTUyNjllODYwM2Q0NDZjMGRmZTkwMWI0MjUzNmNm
15
+ OWRmODZjMTY3YmEzYjQwOTBiMDY0YzE2YzA4YzdlOGQ0MjBiNGI=
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in pedant.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  Pedant, a static analysis tool for NASL
2
2
  =======================================
3
3
 
4
+ [![Gem Version](http://img.shields.io/gem/v/nasl-pedant.svg?style=flat-square)](https://rubygems.org/gems/nasl-pedant)
5
+
6
+
4
7
  Installing
5
8
  ----------
6
9
  If you have Ruby 1.9.3+ and Rubygems installed, you can simply do:
@@ -13,6 +16,32 @@ To check a script, run this: `pedant check scriptname.nasl`. You can check
13
16
 
14
17
  See a `[WARN]` but there's no explanation of the problem? Try adding `-v`.
15
18
 
19
+ Development
20
+ -----------
21
+
22
+ This project uses [Bundler](http://bundler.io/).
23
+
24
+ If you have a brand-new Debian machine, do this as root:
25
+
26
+ apt-get install ruby-dev rubygems git
27
+ gem install bundler
28
+
29
+ As your regular user:
30
+
31
+ git clone https://github.com/tenable/pedant
32
+ cd pedant
33
+ bundle install --path vendor/bundle
34
+ bundle exec rake tests
35
+
36
+ All the tests should pass!
37
+
38
+ To run the Pedant command line, do `bundle exec ./bin/pedant`, which should give
39
+ a help message.
40
+
41
+ If you get an error like this, try prefixing your command with `bundle exec`:
42
+
43
+ /usr/lib/ruby/2.x.x/rubygems/core_ext/kernel_require.rb:NN:in `require': cannot load such file -- libname (LoadError)
44
+
16
45
  Bugs
17
46
  ----
18
47
 
@@ -82,8 +82,6 @@ module Pedant
82
82
  report(:error, call.args[0].context(call))
83
83
  elsif call.args.length > 1
84
84
  report(:error, call.args[1].context(call))
85
- else
86
- raise "hello"
87
85
  end
88
86
  end
89
87
  end
@@ -32,7 +32,7 @@ module Pedant
32
32
 
33
33
  def check(file, tree)
34
34
  def walk(node, root)
35
- # Assignments of literals are the most likely to be bugs (determined empiracally).
35
+ # Assignments of literals are the most likely to be bugs (determined empirically).
36
36
  literals = [
37
37
  Nasl::String,
38
38
  Nasl::Integer,
@@ -85,6 +85,7 @@ module Pedant
85
85
  "ACT_GATHER_INFO",
86
86
  "ACT_ATTACK",
87
87
  "ACT_MIXED",
88
+ "ACT_MIXED_ATTACK",
88
89
  "ACT_DESTRUCTIVE_ATTACK",
89
90
  "ACT_COMPLIANCE_CHECK",
90
91
  "ACT_PATCH_SETUP",
data/lib/pedant/cli.rb CHANGED
@@ -45,10 +45,6 @@ module Pedant
45
45
  opts.separator ""
46
46
  opts.separator "Global settings:"
47
47
 
48
- opts.on('-v', '--verbose', 'Output more information, use multiple time to increase verbosity.') do
49
- options[:verbosity] += 1
50
- end
51
-
52
48
  opts.separator ""
53
49
  opts.separator "Common operations:"
54
50
 
@@ -62,6 +58,13 @@ module Pedant
62
58
  exit 1
63
59
  end
64
60
 
61
+ opts.on('-v') do
62
+ puts "The -v argument now comes after the `check` subcommand. Like so:"
63
+ puts " pedant check -v file.nasl"
64
+ puts "For the version, do -V or --version."
65
+ exit 1
66
+ end
67
+
65
68
  opts.on('-V', '--version', 'Display the version of Pedant.') do
66
69
  puts "#{Pedant::VERSION}"
67
70
  exit
@@ -93,6 +93,10 @@ module Pedant
93
93
  opts.on('-q', '--quiet', "Only speak up when something should be fixed.") do
94
94
  options[:quiet] = true
95
95
  end
96
+
97
+ opts.on('-v', '--verbose', 'Output more information, use multiple time to increase verbosity.') do
98
+ options[:verbosity] += 1
99
+ end
96
100
  end
97
101
 
98
102
  # Load all of the checks.
@@ -1,3 +1,3 @@
1
1
  module Pedant
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -59,7 +59,7 @@ class TestNonsenseComparison < Test::Unit::TestCase
59
59
  )
60
60
  end
61
61
 
62
- def test_isnull_literal_string
62
+ def test_isnull_literal_integer
63
63
  check(
64
64
  :fail,
65
65
  :CheckNonsenseComparison,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nasl-pedant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mak Kolybabi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-09-11 00:00:00.000000000 Z
13
+ date: 2016-02-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -167,3 +167,4 @@ test_files:
167
167
  - test/unit/checks/test_plugin_type_not_specified.rb
168
168
  - test/unit/checks/test_script_family_not_specified.rb
169
169
  - test/unit/checks/test_uses_octal_integers.rb
170
+ has_rdoc: