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

linter: null safety for functions, methods and properties for classes #1245

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Hidanio
Copy link
Contributor

@Hidanio Hidanio commented Feb 12, 2025

No description provided.

@Hidanio Hidanio self-assigned this Feb 12, 2025
@Hidanio Hidanio force-pushed the hidanio/class_null_safety branch 2 times, most recently from 7f516ba to a4e513d Compare February 16, 2025 19:45
@Hidanio Hidanio marked this pull request as ready for review February 17, 2025 08:23
@Hidanio Hidanio added enhancement New feature or request Rules Related to rules support (not dynamic) labels Feb 17, 2025
@Hidanio Hidanio force-pushed the hidanio/class_null_safety branch from 2972b37 to 88b0bb0 Compare February 19, 2025 23:18
@@ -129,6 +129,7 @@ type FuncInfo struct {
Flags FuncFlags
ExitFlags int // if function has exit/die/throw, then ExitFlags will be <> 0
Internal bool
IsVariadic bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would combine this with Flags. It already has information about IsDeprecated, IsPure.
Or create separate flags for the types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return isNullable
}

func IsTypeMixed(typ Map) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just type.Contains("mixed")? in this case, you're looking at []mixed simply as mixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I missed this

return fn.Params[paramIndex]
}

func formatSlashesFuncName(fn meta.FuncInfo) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? You've broken the FQN

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This is only used in the error message output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Rules Related to rules support (not dynamic)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants