nasl-pedant 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/Gemfile +1 -1
- data/README.md +29 -0
- data/lib/pedant/checks/arity_of_builtins.rb +0 -2
- data/lib/pedant/checks/conditional_contains_assignment.rb +1 -1
- data/lib/pedant/checks/script_category.rb +1 -0
- data/lib/pedant/cli.rb +7 -4
- data/lib/pedant/commands/check.rb +4 -0
- data/lib/pedant/version.rb +1 -1
- data/test/unit/checks/test_nonsense_comparison.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGNlMmFiYThiNDA5OGE3MmUyZDcwMTM3ZGMxODdhN2ZlYzliMDQzNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTY1NDYwOTM2NTQ3ZDZlZGFjNjVlODY4YTUzY2QzMmZkYzRkN2ExMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWYyMjg0MjExZTIyMzliNjQ5MzI1YWRjOWZhNDdlNjhiMjA3ZTUxNDE4OThh
|
10
|
+
ODIxM2QxODk5MThkODI5YWY0NGM2Njg1OWI3ZTkyOGRjNDY3YmU0NjA4YmI1
|
11
|
+
ZWQwMGRkNmI0ODI4ZTA0ZDlmMTNlMTk4MTcyNGRiMTdkM2JjNTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGM1ZjYxZGUwMWE4M2I0ODQ5NGUyODFlNGM0NTc3ODZjMGE1NTAzYTQ1Nzgz
|
14
|
+
MDg2MWYzZDk3OGY1YWUxOTUyNjllODYwM2Q0NDZjMGRmZTkwMWI0MjUzNmNm
|
15
|
+
OWRmODZjMTY3YmEzYjQwOTBiMDY0YzE2YzA4YzdlOGQ0MjBiNGI=
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
Pedant, a static analysis tool for NASL
|
2
2
|
=======================================
|
3
3
|
|
4
|
+
[](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
|
|
@@ -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
|
35
|
+
# Assignments of literals are the most likely to be bugs (determined empirically).
|
36
36
|
literals = [
|
37
37
|
Nasl::String,
|
38
38
|
Nasl::Integer,
|
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.
|
data/lib/pedant/version.rb
CHANGED
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.
|
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:
|
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:
|