bvobart / mllint

`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
https://bvobart.github.io/mllint/
GNU General Public License v3.0
75 stars 4 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #29

Closed amritpurshotam closed 3 years ago

amritpurshotam commented 3 years ago

System Information

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19043 N/A Build 19043
Python 3.7.5
mllint version: 0.12.0
commit: 400f497aaf361481c6a650464767c52afecd7081
date: 2021-08-04T20:54:27Z
took: 8.7563ms

Steps to Reproduce

I run mllint src (src is my source code directory) and get the following error

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x6b28a6]

The full output is below

Linting project at  C:\Development\computer-vision-papers/src
No .mllint.yml or pyproject.toml found in project folder, using default configuration
---

✔️ Done - Custom Rules (0.00 ms)
⏳ Waiting - Version Control (0.00 ms)
✔️ Done - Dependency Management (0.56 ms)
🏃 Running - Continuous Integration (CI) (0.00 ms)
🏃 Running - Code Quality (0.00 ms)
✔️ Done - Testing (0.56 ms)
Analysing project... (4/8)

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x6b28a6]

goroutine 72 [running]:
github.com/bvobart/mllint/utils.FileExists(0xc0015812c0, 0x50, 0x2)
        /home/runner/work/mllint/mllint/utils/files.go:18 +0xa6
github.com/bvobart/mllint/setools/ciproviders.Azure.Detect(0xc000fc9050, 0x29, 0x40)
        /home/runner/work/mllint/mllint/setools/ciproviders/azure.go:19 +0xb3
github.com/bvobart/mllint/setools/ciproviders.Detect(0xc000fc9050, 0x29, 0x1afe3c0, 0xc0002da708, 0xb41648)
        /home/runner/work/mllint/mllint/setools/ciproviders/providers.go:37 +0xc9
github.com/bvobart/mllint/linters/ci.(*CILinter).LintProject(0x1b57af0, 0xc000fc9050, 0x29, 0xc000a3e440, 0x3c, 0xc0000e9f80, 0x28, 0xc0000acba0, 0xb, 0x1, ...)
        /home/runner/work/mllint/mllint/linters/ci/linter.go:27 +0xaf
github.com/bvobart/mllint/commands/mllint.(*MLLintRunner).runTask.func1(0xc000504d80, 0xc000a30480)
        /home/runner/work/mllint/mllint/commands/mllint/queueworker.go:89 +0xdf
created by github.com/bvobart/mllint/commands/mllint.(*MLLintRunner).runTask
        /home/runner/work/mllint/mllint/commands/mllint/queueworker.go:83 +0x74
amritpurshotam commented 3 years ago

Nevermind realised it's meant to be on the full project and not just code 😅

bvobart commented 3 years ago

Indeed, mllint is meant to be run on the project's root directory instead of the src directory. Nevertheless, that panic shouldn't happen. I'll look into it, should be a simple fix.