ZK Client MVVM Linter Starter is the starter project for ZK Client MVVM Linter, a tool designed for identifying potential compatibility issues in Server MVVM files before upgrading to Client MVVM.
For a detailed guide on how to set up and run the linter, please refer to our blog post: Introducing ZK Client MVVM Linter.
- Check
app.properties
in this project to set your target path forzulDir
,javaDir
, and other options - Run with
./gradlew runLinter
For a comprehensive list of all lint rules along with their descriptions, please refer to the RULES.md file.
For a detailed guide on how to create custom lint rules, please refer to our blog post:
Introducing ZK Client MVVM Linter.
Additionally, you can find some examples in the org.zkoss.zklinter.upgrade.rule
package.
Specify custom rule org.zkoss.zklinter.upgrade.rule.ZK10Upgrade
in app.properties
to scan zul for removed attributes in order to upgrade to ZK 10.
customRules=org.zkoss.zklinter.upgrade.rule.*
If you just want to scan zul for upgrade, you can disable client mvvm related rules:
disabledRules=org.zkoss.zklinter.impl.rule.*
While ZK Client MVVM Linter covers most scenarios, there are still some limitations you should be aware of:
- The linter does not check Xhtml files, only MVVM Zul and ViewModel Java files.
- The linter does not check Java code that is directly embedded into Zul files, it is recommended to separately declare each ViewModel in its own Java file.
- The linter does not analyze files that are associated through dynamic path binding.
- The linter does not take the usage of
<alias>
andProxyTargetHandler
into account, please note thatProxyTargetHandler
is not supported for Client MVVM.
Thank you for using ZK Client MVVM Linter!
If you are using Maven, follow the instructions below:
- Include the zklinter jar:
<dependency>
<groupId>org.zkoss.zk</groupId>
<artifactId>zklinter</artifactId>
<version>10.1.0-Eval</version>
</dependency>
Check https://mavensync.zkoss.org/maven2/org/zkoss/zk/ for the latest version. 2. Add app.properties 3. Put upgrade rule classes into your project source. 4. Run zklinter with exec-maven-plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>zklinter</id>
<phase>process-resources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.zkoss.zklinter.App</mainClass>
</configuration>
</execution>
</executions>
</plugin>
Then run the Maven goal below to start scanning:
mvn process-resources