We have a big quantity of functions in legacy-code that have no access level specified, so they all fall back into the default access level, "Internal". I would like to make them all "Private" and see if there are any build errors, so that I can quickly tell if some of them should be converted to Private. I can't find a quick way of doing that. Does anyone know of a tool or a trick for that? Maybe a shell script or a linter with this feature?
Use the following Regular Expression. It matchs all lines that starts with func
.
^\s*func
^
matches start of line
\s*
matches any number of space. You may have different levels of indentation.
You can use or (|
) operator to match @objc
and mutating
.
^\s*func|@objc|mutating
You may not need to change the access modifiers in SceneDelegate
and AppDelegate
. If so, click on In Project
and then choose the following search scope.