+
Skip to content

How to correctly utilise nilaway #299

Open
@mahinkhankishizade

Description

@mahinkhankishizade

Hello team,

I am currently trying to add nilaway to my makefile, my intention is to run make nilaway and for it to analyze the modified files only. So imagine my repository is the following:

pkg
      pkga
            file1.go
      file2.go
pkg2
      pkgb
            file3.go
            file4.go

I am modifying file4.go and file1.go, my nilaway command runs as:

nilaway -include-pkgs="pkg,pkg2" ./pkg/pkga/file1.go
nilaway -include-pkgs="pkg,pkg2" ./pkg2/pkgb/file4.go

However I receive a lot of warning such as undefined, or such as below:

nilaway_config: analysis skipped due to errors in package
ctrlflow: analysis skipped due to errors in package
nilaway_struct_field_analyzer: failed prerequisites: nilaway_config@command-line-arguments
nilaway_anonymous_func_analyzer: failed prerequisites: nilaway_config@command-line-arguments
buildssa: analysis skipped due to errors in package
nilaway_function_contracts_analyzer: failed prerequisites: buildssa@command-line-arguments, nilaway_config@command-line-arguments

Could you please advice how should I use the command? What exactly should I input in include-pkgs flag?
My script fetches all modified files, excludes any file that is not .go, any file that has test and mock keywords in it. Then for each file I run the nilaway command (assumption is nilaway analyzes that file and takes into account the package).

Also, my main intention is to run the analysis on the new files that I am going to merge into master, is there any flag that does it automatically?

Thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载