-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: openvas-nasl-lint informs about include error on function calls
When linting a `main.nasl` as ``` include ("2.inc"); include ("1.inc"); hello(); ``` Based on `2.inc`: ``` function hello() { hi(); display("hello"); } ``` Based on `1.inc`: ``` function hi() { display("hi"); } ``` `openvas-nasl-lint --strict-includes main.nasl` will identify the include order: ``` lib nasl-Message: 13:33:42.763: [1166407](main.nasl:0) 2.inc must be included after 1.inc (usage of hi). lib nasl-Message: 13:33:42.763: [1166407](main.nasl:2) The included file '2.inc' is never used. lib nasl-Message: 13:33:42.764: [1166407](main.nasl:2) The included file '1.inc' is never used. 4 errors while processing main.nasl. 1 scripts with one or more errors found ``` Currently strict-includes are not a default when running openvas-nasl-lint since there are circumstances where it is currently legal to have unorderd includes. This may change in the future.
- Loading branch information
1 parent
92f7b98
commit 6e3a09f
Showing
7 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters