go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.08k stars 5.49k forks source link

Gather suggestions for gitea-vet #11097

Closed jolheiser closed 4 years ago

jolheiser commented 4 years ago

Now that we implemented a custom vet tool I'd like to open an issue to gather ideas on things to add to it.

For reference, I took the inspiration from a mattermost blog post about how they use their vet tool.

As an example, currently the tool checks for license headers in files and import ordering.

6543 commented 4 years ago

Check If we have xorm Insert statements witch could posibly add nil slices

6543 commented 4 years ago

in models: unexpoted function should always use e Engine and never x so just check if there is a *= x.* in a func

6543 commented 4 years ago

If a exported function has Init a new Session from this line on only dont allow usage of x either

6543 commented 4 years ago

common xorm bugs ☝️

lunny commented 4 years ago

That is, in a function under models, when the first param is e Engine, then it and all invoked functions should not have a reference to x.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

jolheiser commented 4 years ago

The above have been moved to the gitea-vet repo, so I will close this issue. More issues there are welcome. 🙂