Skip to content

Conversation

ABaldwinHunter
Copy link
Contributor

This commit updates build-content script (invoked during docker build)
to write all rules to simply
./content/{#rule}.txt

instead of nesting them under:

./content/#{category}/#{rule}.txt

The update is cleaner and fixes a problem:

  1. no complexity content due to phpmd quirky discrepancy between rule
    category name in documentation and in phpmd code itself.

!tldr:
My first approach tried to make the doc path during
build match the check-naming in phpmd code, but this was messy and required
conditional logic in a few places.

The rule names are unique so they suffice for the lookup.

https://github.com/codeclimate/codeclimate-phpmd/blob/master/Category.php#L72

@codeclimate/review

Copy link
Contributor

Choose a reason for hiding this comment

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

It might feel like overkill, but we probably want a mapping for this. I'm sure there will be more in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 thanks for suggestion

This commit updates build-content script (invoked during docker build) to write all rules to simply `./content/{#rule}.txt` instead of nesting them under: `./content/#{category}/#{rule}.txt` The update is cleaner and fixes a problem: 1) no complexity content due to phpmd quirky discrepancy between rule category name in documentation and in phpmd code itself. `!tldr`: My first approach tried to make the doc path during build match the check-naming in phpmd code, but this was messy and required conditional logic in a few places. The rule names are unique so they suffice for the lookup. https://github.com/codeclimate/codeclimate-phpmd/blob/master/Category.php#L72
@gdiggs
Copy link
Contributor

gdiggs commented Dec 8, 2015

LGTM

ABaldwinHunter pushed a commit that referenced this pull request Dec 8, 2015
Simplify and fix issue documentation
@ABaldwinHunter ABaldwinHunter merged commit 093ad45 into master Dec 8, 2015
@ABaldwinHunter ABaldwinHunter deleted the abh-issue-content branch December 8, 2015 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants