Closed jechlin closed 5 years ago
that's a good idea. I'm currently (too) busy with other things - but I'd very much like to support you, if you like to approach this issue...
thanx for your interest in htmlSC, Gernot
I'm looking into providing a PR with this. In my opinion this requires a bigger change and I would like to confirm with you, @gernotstarke, that you're happy with what I would like to do:
Configuration.ITEM_NAME_sourceDir
and change Configuration.ITEM_NAME_sourceDocuments
to be treated as a collection of File
ssourceDir
from HtmlSanityCheckTask
sourceDocuments
on HtmlSanityCheckTask
to be a org.gradle.api.file.FileCollection
which is easy to be turned into a set of File
s using its getFiles()
method and use that in HtmlSanityCheckTask.setupConfiguration()
Configuration.ITEM_NAME_sourceDocuments
straight through in AllChecksRunner
's constructor instead of using FileCollector.getHtmlFilesToCheck()
FileCollector.getHtmlFilesToCheck()
methods together with any methods that are only used from them and any tests exercising the removed codeProject.fileTree()
so that they exactly match the current logic with regards to recursively finding files in sourceDir
as well as matching files by names specified in sourceDocuments
These are obviously breaking changes but I believe that they will provide a much more flexible mechanism for specifying which files to check compared to what's currently there thanks to using the outstanding finding and filtering capabilities of Gradle's FileCollection API.
@erdi, thank you so much for your structured proposal: Yes, I'm perfectly happy with your suggestions, they sound plausible to me.
I'm honored to have you "on board"...
(with your massive experience in testing: in case you have any suggestions on how to better and/or more effectively test htmlSC - please feel free...)
regards, Gernot
Thanks for confirming that you’re happy with the proposed changes. Hopefully I will find some time tomorrow to make them and submit a PR.
I’m not sure what you mean by me “being on board” but we are using your sanity checker on a project at work and I’m just contributing back changes that we had to apply in a custom built artifact to be able to use it. I hate custom builds and forks and it makes me very happy that contributing back to the project has been so swift so far - thanks for being so responsive to issues and PRs.
With regards to testing I’m not sure I see anything standing out that would need changing. I was very positively surprised that an integration test using GradleRunner has already been in place as I’m used to writing one from scratch when contributing back to Gradle plugin projects.
On Sat, 9 Feb 2019 at 17:25, Dr. Gernot Starke notifications@github.com wrote:
@erdi https://github.com/erdi, thank you so much for your structured proposal: Yes, I'm perfectly happy with your suggestions, they sound plausible to me.
I'm honored to have you "on board"...
(with your massive experience in testing: in case you have any suggestions on how to better and/or more effectively test htmlSC - please feel free...)
regards, Gernot
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aim42/htmlSanityCheck/issues/264#issuecomment-462062801, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMii3YdNjuzJ2rRvzZtAErzsT2o-QVvks5vLwSbgaJpZM4ankEO .
I'd suggest using ConfigurableFileCollection
instead, to start making use of lazy configuration:
https://docs.gradle.org/current/userguide/lazy_configuration.html
I might be missing something but as far as I understand what I suggested will not prevent you from assigning a ConfigurableFileCollection
to HtmlSanityCheckTask.sourceDocuments
if you so wish. I also don't see why my proposal would be at odds with using lazy configuration. Can you please elaborate, @thc202?
That one can set a ConfigurableFileCollection
into HtmlSanityCheckTask.sourceDocuments
does not make it a lazy property (thus one is still with the same problems that lazy configuration meant to solve).
I find being able to use FileCollection API for specifying which files to check and changing properties on HtmlSanityCheckTask
to org.gradle.api.provider.Property
(as that is what I believe you are suggesting, @thc202, albeit in a very convoluted way) to be two orthogonal concerns.
While I think using lazy properties everywhere (it makes sense) is the ultimate goal I was not suggesting that. I just suggested using ConfigurableFileCollection
instead of FileCollection
, it was a quick win, especially since the API is already being broken. (Granted I was not explicit on the whole changes required (i.e. making sourceDocuments
final also) but linked to the documentation which shows that.)
have you "on board"...
Marcin, by "on board" I meant that I feel honoured having you as contributor.
I think I now understand what you meant. Instead of making
sourceDocuments
a writable FileCollection
you suggest making it a read
only ConfigurableFileCollection
initialized to a FileTree
based on
sourceDir
. I will submit a PR with such change.
On Sun, 10 Feb 2019 at 17:00, thc202 notifications@github.com wrote:
While I think using lazy properties everywhere (it makes sense) is the ultimate goal I was not suggesting that. I just suggested using ConfigurableFileCollection instead of FileCollection, it was a quick win, especially since the API is already being broken. (Granted I was not explicit on the whole changes required (i.e. making sourceDocuments final also) but linked to the documentation which shows that.)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aim42/htmlSanityCheck/issues/264#issuecomment-462151235, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMii2sRbdI6WYjterNFtn4JohSNLtbxks5vMFAogaJpZM4ankEO .
Currently you can only pass a single root directory, plus list of files.
Using a gradle FileCollection would give the user much more control, as we could exclude certain directories.