Skip to content

Commit

Permalink
chore(deps): Update pre-commit hooks (./upgrade.bash + fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Apr 28, 2023
1 parent fa64f05 commit 758b9e9
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 35 deletions.
1 change: 1 addition & 0 deletions .markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
rev: v1.5.1
hooks:
- id: insert-license
files: \.(proto)$
Expand Down Expand Up @@ -86,7 +86,7 @@ repos:
- --use-current-year

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.7
rev: v16.0.2
hooks:
- id: clang-format
# clang-format can also do e.g. *.java and *.json but we only want proto
Expand All @@ -97,7 +97,7 @@ repos:
files: \.(proto|textproto)$

- repo: https://github.com/yoheimuta/protolint
rev: v0.43.1
rev: v0.43.2
hooks:
- id: protolint

Expand All @@ -112,22 +112,22 @@ repos:
args: [--autofix, --aosp, --google-java-formatter-version=1.16.0]

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.6.0
rev: v0.7.1
hooks:
- id: markdownlint-cli2
exclude: (^.github/|src/test/resources/|docs/use/library/docgen.md)

# Until https://github.com/DavidAnson/markdownlint/issues/586
# Until https://github.com/DavidAnson/markdownlint/issues/121
- repo: https://github.com/tcort/markdown-link-check
rev: v3.11.0
rev: v3.11.1
hooks:
- id: markdown-link-check
exclude: (^src/test/resources/|docs/use/library/docgen.md)
args: [--quiet]
args: [--quiet, --config, .markdown-link-check.json]

# Alternative: https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md
- repo: https://github.com/keith/pre-commit-buildifier
rev: 6.0.0
rev: 6.1.0.1
hooks:
- id: buildifier
args: &args
Expand All @@ -136,7 +136,7 @@ repos:
args: *args

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
exclude: ^docs/use|core/impl/src/test/resources
Expand Down
17 changes: 17 additions & 0 deletions cli/src/main/java/dev/enola/cli/List.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2023 The Enola <https://enola.dev> Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.enola.cli;

import dev.enola.core.EnolaService;
Expand Down
17 changes: 17 additions & 0 deletions cli/src/main/java/dev/enola/cli/ListKinds.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2023 The Enola <https://enola.dev> Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.enola.cli;

import dev.enola.core.IDs;
Expand Down
4 changes: 1 addition & 3 deletions common/protobuf/src/test/resources/nok.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@
# proto-file: google/protobuf/timestamp.proto
# proto-message: Timestamp

seconds: 123
nanos: 456
bad: xyz
seconds: 123 nanos: 456 bad: xyz
7 changes: 3 additions & 4 deletions common/protobuf/src/test/resources/ok.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# limitations under the License.

# proto-file: google/protobuf/timestamp.proto
# TODO Should proto-message include the package, so google.protobuf.Timestamp? Or support both with and without?
# proto-message: Timestamp
# TODO Should proto-message include the package, so google.protobuf.Timestamp?
# Or support both with and without? proto-message: Timestamp

seconds: 123
nanos: 456
seconds: 123 nanos: 456
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,32 @@ private static void renderGraphvizEntity(EntityKind ek, Appendable md) throws IO

md.append(" \"" + name + "\"[\n");
md.append(" fillcolor=\"#88ff0022\"\n");
md.append(" label=<<table border=\"0\" cellborder=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n");
md.append(
" label=<<table border=\"0\" cellborder=\"1\" cellspacing=\"0\""
+ " cellpadding=\"3\">\n");
md.append(" <tr> <td port=\"name\" sides=\"ltr\"> <b>" + name + "</b></td> </tr>\n");
// TODO add description
//md.append("<tr> <td port="description" sides="ltr"> <b>"+name+"</b></td> </tr>")
// md.append("<tr> <td port="description" sides="ltr"> <b>"+name+"</b></td> </tr>")

for (var pathArgument : pathArguments) {
// TODO hardcoded emoji
md.append(" <tr> <td port=\"" + pathArgument
+ "\" align=\"left\"><br align=\"left\"/>"
+ "&#129409;" + pathArgument
+ "<br align=\"left\"/></td> </tr>\n");
md.append(
" <tr> <td port=\""
+ pathArgument
+ "\" align=\"left\"><br align=\"left\"/>"
+ "&#129409;"
+ pathArgument
+ "<br align=\"left\"/></td> </tr>\n");
}
for (var linkKey : ek.getLinkMap().keySet()) {
// TODO hardcoded emoji
md.append(" <tr> <td port=\""
+ linkKey + "\" align=\"left\"><br align=\"left\"/>"
+ "&#129409;" + linkKey + "<br align=\"left\"/></td> </tr>\n");
md.append(
" <tr> <td port=\""
+ linkKey
+ "\" align=\"left\"><br align=\"left\"/>"
+ "&#129409;"
+ linkKey
+ "<br align=\"left\"/></td> </tr>\n");
}
md.append(" </table>>\n");
md.append(" shape=plain\n");
Expand All @@ -79,10 +88,18 @@ private static void renderGraphvizEntity(EntityKind ek, Appendable md) throws IO
var id = related.getValue().getId();
md.append(
" "
+ "\"" + name + "\":\"" + key + "\""
+ "\""
+ name
+ "\":\""
+ key
+ "\""
+ " -> "
+ "\"" + StringUtil.capitalize(id.getEntity()) + "\":name"
+ "[dir=forward label=\""+key+ "\" color=\"#00440088\"];"
+ "\""
+ StringUtil.capitalize(id.getEntity())
+ "\":name"
+ "[dir=forward label=\""
+ key
+ "\" color=\"#00440088\"];"
+ "\n");
}
}
Expand Down
6 changes: 1 addition & 5 deletions core/impl/src/test/resources/foo-abc.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@
# proto-file: dev/enola/core/enola_core.proto
# proto-message: Entity

id {
ns: "demo"
entity: "foo"
paths: "abc"
}
id { ns: "demo" entity: "foo" paths: "abc" }
2 changes: 0 additions & 2 deletions docs/dev/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ This project, like any software, stands on the shoulders of giants, and depends
[`./update.bash`](../../update.bash) shows some of and where possible automatically updates these dependencies.
It should be regularly (manually) run by maintainers of this project.

**TODO** _Set up Renovate Bot!_

## Runtime Dependencies

* [`MODULE.bazel`](../../MODULE.bazel) contains the Java Maven Group, Artifact & Versions (GAV), see [our Bazel doc](bazel.md)
Expand Down

0 comments on commit 758b9e9

Please sign in to comment.