-
Notifications
You must be signed in to change notification settings - Fork 25.2k
converting ForbiddenPatternsTask to .java #36194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
converting ForbiddenPatternsTask to .java #36194
Conversation
Pinging @elastic/es-core-infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you contribution @cdschneider !
I left a few minor comments.
Some of them were already there in the Groovy code but I think this is a good opportunity to take care of them.
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
@elasticmachine test this please |
…groovy-forbidden-task
@elasticmachine test this please |
…t to assert file marker name = task name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cdschneider ! We're almost there, I left just a few comments for small things.
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
.stream() | ||
.map(sourceSet -> sourceSet.getAllSource().matching(filesFilter)) | ||
.reduce(FileTree::plus) | ||
.orElse(getProject().files().getAsFileTree()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getProject().files()
returns a file collection, no need for getAsFileTree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the result of reduce()
is an Optional<FileTree>
, doesn't the result of the .orElse()
statement also need be of type FileTree
?
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
There are non UTF-8 files in other projects too it seems.
Might be worth to catch the exception and wrap it to include the offending file in the error message. You'll be able to fond them all by running |
@elasticmachine test this please |
@elasticmachine test this please |
Thanks again for your contribution @cdschneider, we really appreciate it! |
* converting ForbiddenPatternsTask to java impl & unit tests
No problem! Glad I could help! 😄 I will definitely be trying to contributie again soon! |
* elastic/master: (36 commits) Add check for minimum required Docker version (elastic#36497) Minor search controller changes (elastic#36479) Add default methods to DocValueFormat (elastic#36480) Fix the mixed cluster REST test explain/11_basic_with_types. Modify `BigArrays` to take name of circuit breaker (elastic#36461) Move LoggedExec to minimumRuntime source set (elastic#36453) added 6.5.4 version Add test logging for elastic#35644 Tests- added helper methods to ESRestTestCase for checking warnings (elastic#36443) SQL: move requests' parameters to requests JSON body (elastic#36149) [Zen2] Respect the no_master_block setting (elastic#36478) Require soft-deletes when access changes snapshot (elastic#36446) Switch more tests to zen2 (elastic#36367) [Painless] Add extensive tests for def to primitive casts (elastic#36455) Add setting to bypass Rollover action (elastic#36235) Try running CI against Zulu (elastic#36391) [DOCS] Reworked the shard allocation filtering info. (elastic#36456) Log [initial_master_nodes] on formation failure (elastic#36466) converting ForbiddenPatternsTask to .java (elastic#36194) fixed typo ...
a part of #34459 specifically
ForbiddenPatternsTask