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

New Idea: use AI pipeline to auto find the bug pattern #9

Open
alingse opened this issue Feb 25, 2025 · 1 comment
Open

New Idea: use AI pipeline to auto find the bug pattern #9

alingse opened this issue Feb 25, 2025 · 1 comment

Comments

@alingse
Copy link
Owner

alingse commented Feb 25, 2025

Pipeline

  1. Search "fix small bug" + "Go" + "pull requests" --> https://github.com/search?q=fix+bug+language%3AGo&type=pullrequests&l=Go
  2. Read each PR diff find the bug's Root cause
  3. Auto summarize the new parttern

Some Human Result

Error usage

  1. err.Error() == "EOF" should be errors.Is(err, io.EOF) ---> https://github.com/inelpandzic/simpledb/pull/3/files

this can be generalized to all other std error like context.Canceld

  1. if err != nil && other condition not cover all err != nil ---> https://github.com/kubevirt/kubevirt/pull/13759/files

this may cause some bug

Body Close like

  1. file should Close --> https://github.com/etcd-io/etcd/pull/18086/files

Make wrong length

  1. make slice and range from another ---> https://github.com/zenon-network/go-zenon/pull/49/files

Already report by other linter

  1. [ruleguard] A && A should be simplify to A ---> https://github.com/blocktree/go-owcrypt/pull/12/files
  2. [gosimple] *x == true should be reduce to *a ---> https://github.com/aunefyren/poenskelisten/pull/33/files
  3. [gocritic] len(x) >= 0 is always true, it should be len(x) > 0 ---> https://github.com/rook/rook/pull/15445/files
  4. Printf to Print --> https://github.com/Tulsishah/gcsfuse-tulsishah7/pull/17/files
  5. return data, err should be return data, nil --> https://github.com/lightningnetwork/lnd/pull/9519/files
@fuyangpengqi
Copy link

Good job! But I’m curious why 6 and 7 are missing?

I came here from a PR under the lnd project. May I ask are you Chinese? I'm also very interested in static analysis.

My WeChat yibeizhanyongla. Looking forward to more communication.

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

2 participants