Skip to content

Commit

Permalink
#113: Use single format of TODO items within your codebase (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgroup authored Apr 29, 2022
1 parent c997637 commit d1ff878
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,33 @@
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>arch4u rules related to code style</description>
<!-- @todo #113/DEV TodoFormat: Add reference to the discussions from 'message' and 'externalInfoUrl'. -->
<rule name="TodoFormat"
since="0.2.0"
language="java"
externalInfoUrl="https://github.com/dgroup/arch4u-pmd/discussions/..."
message="Use single format of TODO items within your codebase: https://github.com/dgroup/arch4u-pmd/discussions/..."
externalInfoUrl="https://github.com/dgroup/arch4u-pmd/discussions/137"
message="Use single format of TODO items within your codebase: https://github.com/dgroup/arch4u-pmd/discussions/137"
class="io.github.dgroup.arch4u.pmd.TodoFormat">
<!-- @todo #113/DEV TodoFormat: Make proper description and example for this rule -->
<description>
...
Read more: https://github.com/dgroup/arch4u-pmd/discussions/...
Use single format of TODO items within your codebase.
Read more: https://github.com/dgroup/arch4u-pmd/discussions/137
</description>
<priority>3</priority>
<example>
...
/**
* ...
* TODO Add REST API endpoint that supports OpenAPI and Web-Flux
* We need a way how to generate OpenAPI specifications that supports Web-Flux.
* Ensure that ....
* labels: enhancement, help wanted
* assignees: dgroup
* milestone: 2
*
* Other javadoc elements
* @return The id of created entity.
*/
public Long create(@Valid @RequestBody Employee employee) {
// ...
}
</example>
</rule>
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public class User {
<expected-problems>1</expected-problems>
<expected-linenumbers>10</expected-linenumbers>
<expected-messages>
<message>The TODO subject " - TODO Wrong subject" should start from TODO, non-blank and less or equal 255: https://github.com/dgroup/arch4u-pmd/discussions/...</message>
<message>The TODO subject " - TODO Wrong subject" should start from TODO, non-blank and less or equal 255: https://github.com/dgroup/arch4u-pmd/discussions/137</message>
</expected-messages>
<code><![CDATA[
public class User {
Expand Down Expand Up @@ -201,7 +201,7 @@ public class User {
<expected-problems>1</expected-problems>
<expected-linenumbers>10</expected-linenumbers>
<expected-messages>
<message>The TODO subject " - TODO" should start from TODO, non-blank and less or equal 255: https://github.com/dgroup/arch4u-pmd/discussions/...</message>
<message>The TODO subject " - TODO" should start from TODO, non-blank and less or equal 255: https://github.com/dgroup/arch4u-pmd/discussions/137</message>
</expected-messages>
<code><![CDATA[
public class User {
Expand Down Expand Up @@ -234,7 +234,7 @@ public class User {
<expected-problems>1</expected-problems>
<expected-linenumbers>2</expected-linenumbers>
<expected-messages>
<message>The TODO subject " TODO Subject is too big and more than 5 symbols allowed" should start from TODO, non-blank and less or equal 5: https://github.com/dgroup/arch4u-pmd/discussions/...</message>
<message>The TODO subject " TODO Subject is too big and more than 5 symbols allowed" should start from TODO, non-blank and less or equal 5: https://github.com/dgroup/arch4u-pmd/discussions/137</message>
</expected-messages>
<code><![CDATA[
/**
Expand Down Expand Up @@ -274,7 +274,7 @@ public class User {
<expected-problems>1</expected-problems>
<expected-linenumbers>3</expected-linenumbers>
<expected-messages>
<message>The TODO description "[ 1st line, 2nd line]" should be aligned and has at least 5 or more words: https://github.com/dgroup/arch4u-pmd/discussions/...</message>
<message>The TODO description "[ 1st line, 2nd line]" should be aligned and has at least 5 or more words: https://github.com/dgroup/arch4u-pmd/discussions/137</message>
</expected-messages>
<code><![CDATA[
/**
Expand Down

1 comment on commit d1ff878

@0pdd
Copy link

@0pdd 0pdd commented on d1ff878 Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to retrieve PDD puzzles from the code base and submit them to GitHub. If you think that it's a bug on our side, please submit it to yegor256/0pdd:

set -x && set -e && set -o pipefail && cd /tmp/0pdd20220303-12-17lwdzx/dgroup/arch4u-pmd && pdd -v -f /tmp/20220429-31943-1dzk0hu [1]: + set -e + set -o pipefail + cd /tmp/0pdd20220303-12-17lwdzx/dgroup/arch4u-pmd + pdd -v -f /tmp/20220429-31943-1dzk0hu Found 4 lines in...

Please, copy and paste this stack trace to GitHub:

UserError
set -x && set -e && set -o pipefail && cd /tmp/0pdd20220303-12-17lwdzx/dgroup/arch4u-pmd && pdd -v -f /tmp/20220429-31943-1dzk0hu [1]:
+ set -e
+ set -o pipefail
+ cd /tmp/0pdd20220303-12-17lwdzx/dgroup/arch4u-pmd
+ pdd -v -f /tmp/20220429-31943-1dzk0hu

Found 4 lines in /tmp/0pdd20220303-12-17lwdzx/dgroup/arch4u-pmd/.pdd
My version is 0.20.6
Ruby version is 2.6.0 at x86_64-linux
Reading .
Excluding target/**/*
Excluding docs
75 file(s) found, 1626 excluded
/tmp/0pdd20220303-12-17lwdzx/dgroup/arch4u-pmd/mvnw is a binary file (0 bytes)
Reading .gitignore...
Reading mvnw.cmd...
Reading .gitattributes...
Reading .rultor.yml...
Reading pom.xml...
Puzzle DEV-08faa53a 0/DEV at pom.xml
Puzzle DEV-5f4df571 0/DEV at pom.xml
Reading license.txt...
Reading .github/pull_request_template.md...
Reading .github/dependabot.yml...
Reading .github/lock.yml...
Puzzle DEV-6f85efe2 0/DEV at .github/lock.yml
Reading .github/profanity.yml...
Reading .github/contributing.md...
Reading .github/code_of_conduct.md...
Reading .github/workflows/build.yml...
Reading .github/workflows/codeql-analysis.yml...
Puzzle DEV-cfa0d1a0 0/DEV at .github/workflows/codeql-analysis.yml
Reading .github/ISSUE_TEMPLATE/feature_request.md...
Reading .github/ISSUE_TEMPLATE/bug_report.md...
Reading .githooks/commit-msg...
Reading readme.md...
Reading history.md...
Reading .java-version...
Reading build.sh...
Reading src/main/resources/io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml...
Reading src/main/resources/io/github/dgroup/arch4u/pmd/monitoring/arch4u-micrometer-ruleset.xml...
Reading src/main/resources/io/github/dgroup/arch4u/pmd/api/arch4u-rest-ruleset.xml...
Reading src/main/resources/io/github/dgroup/arch4u/pmd/logging/arch4u-logging-ruleset.xml...
Reading src/main/resources/io/github/dgroup/arch4u/pmd/formatting/arch4u-code-style-ruleset.xml...
ERROR: src/main/resources/io/github/dgroup/arch4u/pmd/formatting/arch4u-code-style-ruleset.xml; puzzle at line #36; TODO found, but puzzle can't be parsed, most probably because TODO is not followed by a puzzle marker, as this page explains: https://github.com/yegor256/pdd#how-to-format
If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/yegor256/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/yegor256/pdd/blob/master/README.md.
Exit code is 1

/app/objects/git_repo.rb:66:in `rescue in block in xml'
/app/objects/git_repo.rb:63:in `block in xml'
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/tempfile.rb:295:in `open'
/app/objects/git_repo.rb:62:in `xml'
/app/objects/puzzles.rb:36:in `deploy'
/app/objects/job.rb:38:in `proceed'
/app/objects/job_starred.rb:33:in `proceed'
/app/objects/job_recorded.rb:32:in `proceed'
/app/objects/job_emailed.rb:35:in `proceed'
/app/objects/job_commiterrors.rb:36:in `proceed'
/app/objects/job_detached.rb:48:in `exclusive'
/app/objects/job_detached.rb:36:in `block in proceed'
/app/objects/job_detached.rb:36:in `fork'
/app/objects/job_detached.rb:36:in `proceed'
/app/0pdd.rb:366:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `block in compile!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (3 levels) in route!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1032:in `route_eval'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (2 levels) in route!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1061:in `block in process_route'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `catch'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `process_route'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1011:in `block in route!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `each'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `route!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1129:in `block in dispatch!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1124:in `dispatch!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `block in call!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `call!'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:929:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.1.0/lib/rack/protection/xss_header.rb:18:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.1.0/lib/rack/protection/path_traversal.rb:16:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.1.0/lib/rack/protection/json_csrf.rb:26:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.1.0/lib/rack/protection/frame_options.rb:31:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/logger.rb:17:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/common_logger.rb:38:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:253:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:246:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:216:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1991:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `block in call'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1769:in `synchronize'
/app/vendor/bundle/ruby/2.6.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `call'
/app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/handler/webrick.rb:95:in `service'
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/webrick/httpserver.rb:140:in `service'
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/webrick/httpserver.rb:96:in `run'
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/webrick/server.rb:307:in `block in start_thread'

Please sign in to comment.