Comments (9)
Wouldn't you also need to check if any mutating methods /input functions are called with it?
from swiftlint.
Yeah, this will be a trick one. We can't also predict anything on properties from public API (they might not change inside the file itself, but a consumer may change it).
from swiftlint.
An easier way to do this is trying to replace every (non-public?) var
with let
and let the compiler check if it's still ok.
The problems are that this will probably be much slower and that neither syntax
nor structure
expose this error (but swiftc
does).
from swiftlint.
@mrackwitz is working on a parser for swiftc -dump-ast
so hopefully that'll make it easier to build different kinds of SwiftLint rules based on that version of the AST.
from swiftlint.
👍
I was just about to comment about swiftc -dump-ast
and how helpful it would be.
from swiftlint.
This is now a compiler warning on Swift 2.0, so maybe it should be closed.
from swiftlint.
This is now a compiler warning on Swift 2.0, so maybe it should be closed.
Agreed. Plus, this would have been difficult to do without LLMV IR access.
from swiftlint.
Any chance of supporting this for class / struct properties? I noticed the swift compiler doesn't catch this. Is it too complex to support?
from swiftlint.
It would be possible to build an analyzer rule to do that.
from swiftlint.
Related Issues (20)
- `private_over_fileprivate` produces a false positive when using actor
- Brew repo is not hosting the last version of swiftlint HOT 3
- each variable should have comment HOT 2
- Glob.resolveGlob() is veeeery sloooow HOT 6
- [Swift] Error when importing swiftlint report HOT 5
- Privacy Manifest HOT 1
- Custom rule using lookbehind becomes Invalid configuration HOT 1
- Rule Request: Line break in between case statements HOT 4
- SwiftLint not work with platform=linux/amd64
- SwiftLintPlugin does not honor `included` configuration. Issue? Or expected? HOT 4
- swiftlint analyze appears to stop collecting after 12 files with Swift 5.10 HOT 6
- `unused_import` not taking into account `@_exported import`
- Have a custom rule where if we have a call to a method, we should expect another one HOT 3
- Time for a new release? HOT 2
- Conflict with other macro package HOT 1
- Rule Request: Alphabetise struct property let / vars.
- [unused_declaration] Unused class/struct is not detected if it conforms to a protocol in extension
- Feature request: Add an (opt in) update check to SwiftLint HOT 2
- Dogfood Baselines internally HOT 5
- ShorthandOptionalBinding Rule not working? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftlint.