Don't automatically exclude files ending in Upgradeable #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In @openzeppelin/contracts, the file
contracts/proxy/utils/UUPSUpgradeable.sol
is automatically excluded by the transpiler because of its basename ending inUpgradeable
. I think this is not desirable, because we then have to manually exclude it from the list. In the end, we the file is present in the upgradeable packages, which IMO should not be the case of a stateless contract.I believe this contract should be marked as
@custom:stateless
, and not be transpiled.However, doing so gives us errors from mock contract trying to use it. When transpiling these mocks we get an error from using a symbol that comes from an excluded file.
When we look at the current exlude logic, we see that files can be excluded because they are in the
excludeSet
, because they match one of theexcludeMatch
(that is controlled by options.exclude) or because they are flagged as already renamed. That last part is IMO not right because it basically just another pattern that is applied. If we remove the last case, it's easy to re-enable that behavior using the**/*Upgradeable.*
exclude pattern. IMO, this gives more granular control, which IMO is better.