Skip to content

Commit

Permalink
feat(protobuf): add pre-commit hook for checking backwards compatibil…
Browse files Browse the repository at this point in the history
…ity for protobuf files
  • Loading branch information
murdos committed Sep 13, 2024
1 parent a9f0d43 commit a3d0f57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public JHipsterModule buildProtobufBackwardsCompatibilityCheckModule(JHipsterMod
.pluginManagement(protoBackwardsCompatibilityMavenPluginManagement())
.plugin(protoBackwardsCompatibilityMavenPluginBuilder().build())
.and()
.preCommitActions(stagedFilesFilter("*.proto"), preCommitCommands("() => ['mvn proto-backwards-compatibility:backwards-compatibility-check', 'git add *proto.lock']"))
.build();
//@formatter:on
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,17 @@ void shouldBuildModuleForMaven() {

JHipsterModule module = factory.buildProtobufBackwardsCompatibilityCheckModule(properties);

assertThatModuleWithFiles(module, pomFile())
assertThatModuleWithFiles(module, pomFile(), lintStagedConfigFile())
.hasFile(".lintstagedrc.cjs")
.containing(
"""
module.exports = {
'*.proto': () => ['mvn proto-backwards-compatibility:backwards-compatibility-check', 'git add *proto.lock'],
'*.{md,json,yml,html,css,scss,java,xml,feature}': ['prettier --write'],
};
"""
)
.and()
.hasFile("pom.xml")
.containing(
"""
Expand Down

0 comments on commit a3d0f57

Please sign in to comment.