Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to correctly utilise nilaway #299

Open
mahinkhankishizade opened this issue Feb 11, 2025 · 0 comments
Open

How to correctly utilise nilaway #299

mahinkhankishizade opened this issue Feb 11, 2025 · 0 comments

Comments

@mahinkhankishizade
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant