sort module-info
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先查看 issue 中的 module-info.java 示例以及链接的 JLS 第 7.7 节,以确定 directive 和 modifier 所需的排序。完成的标准是模块声明能够保持一致的排序,其中 requires、requires static 和 requires transitive 分成独立的组,同时 exports 和 opens 也按适当顺序排列。
由索引模型根据 Issue 内容生成。
描述
Prettier-Java 2.5.0
Input:
module com.xenoterracide.tools.java {
exports com.xenoterracide.tools0.java.function;
exports com.xenoterracide.tools0.java.annotation;
requires java.base;
requires jakarta.annotation;
}
Output:
module com.xenoterracide.tools.java {
exports com.xenoterracide.tools0.java.function;
exports com.xenoterracide.tools0.java.annotation;
requires java.base;
requires jakarta.annotation;
}
Expected behavior:
some kind of sorting, for convienience, like sorting imports. Note: I don't think functionally the order matters, but I've linked the JLS spec in case it defines it. It does seem to show an order (that's not alphabetic only). Also I don't have an opinion other than it should sort and should conform to JLS.
I'll be honest, I haven't really read this spec, so please verify my output conforms.. but it looks like it should be as follows. Obviously my example is not comprehensive https://docs.oracle.com/javase/specs/jls/se9/html/jls-7.html#jls-7.7
module com.xenoterracide.tools.java {
requires jakarta.annotation;
requires java.base;
exports com.xenoterracide.tools0.java.annotation;
exports com.xenoterracide.tools0.java.function;
}
note: I think it's acceptable just to make this an alpha sort with some grouping, e.g. requires and requires static and requires transient are different groups. requires stuff shouldn't be mixed next to requires static. This is currently one of my most complex examples.
import org.jspecify.annotations.NullMarked;
/**
* JPA utilities.
*/
@NullMarked module com.xenoterracide.commons.jpa {
exports com.xenoterracide.commons.jpa;
exports com.xenoterracide.commons.jpa.annotation;
exports com.xenoterracide.commons.jpa.util;
exports com.xenoterracide.commons.jpa.transaction to spring.beans, spring.context;
opens com.xenoterracide.commons.jpa to org.hibernate.orm.core, spring.core, org.hibernate.validator;
opens com.xenoterracide.commons.jpa.transaction to spring.core;
requires org.apache.commons.lang3;
requires spring.data.commons;
requires spring.beans;
requires spring.context;
requires spring.tx;
requires org.hibernate.orm.envers;
requires static org.jspecify;
requires static com.xenoterracide.tools.java;
requires static jakarta.annotation;
requires static org.jmolecules.architecture.layered;
requires transitive jakarta.persistence;
requires transitive jakarta.validation;
requires transitive com.xenoterracide.model;
requires org.jmolecules.ddd;
}
- 主要语言
- Java
- 星标
- 1.2k
- 派生
- 122
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 32
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jhipster/prettier-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
jhipster/prettier-java#1113 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
jhipster/prettier-java#1115 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 56/100
jhipster/prettier-java#1114 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 66/100
jhipster/prettier-java#1112 ·
维护者通常 2 天内回复
-
Comment "// @formatter:off" was not printed可能已有人在做 @jtkiesel 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
jhipster/prettier-java#1098 ·
维护者通常 2 天内回复
查看 jhipster/prettier-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
QuiltMC/update-quilt-meta#28 ·
-
awaiting triage Documentation P3
难度 1/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
area/build area/maintainability component/camunda-process-test kind/tech-debt
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToList可能已有人在做 @mohamed-elbrik 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
area/kotlin
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复