cthing / locc4j

A Java library for counting lines of source code.
Apache License 2.0
1 stars 0 forks source link

Show sample output in README #1

Closed ccorneli closed 4 months ago

ccorneli commented 4 months ago

Project looks promising and most likely it is exactly what I need, except.... Unless I'm missing something obvious, I can't find a sample output to see what it might return as a result to be sure. I suggest adding it as a section in the README. Thanks.

baron1405 commented 4 months ago

@ccorneli Thanks for your issue. I have updated the README. If it looks sufficient, please close the issue. If not, let me know what I can add.

ccorneli commented 4 months ago

I see you added a link to Java package for the various classes that implement the AbstractLoccReport, but I was expecting to see a table of the output similar to what I see in the Tokei README for which the gradle plugin mentioned it was "modeled after". I know it is the same idea but I'm not seeing what the end result would look like. Is there another directory with actual reports in those formats that I missed?

baron1405 commented 4 months ago

I think I see the confusion. The locc4j library does not write its results to any file. It only produces the map of languages to line counts. It is up to the consumer of the library (e.g. the Gradle plugin) to write that data in whatever way it desires. I will add this to the README to clarify. Note that you can use my xmlwriter and jsonwriter libraries to write the count results to those file formats as demonstrated in the Gradle plugin.

ccorneli commented 4 months ago

Thanks for the clarification... Then I guess then my question is for the grade plug-in project.... However, It looks like you are also the maintainer of that one. Do you plan to add the output there? Should I create an issue in that project?
I see there is at least a grid which explains features included in each type of output.
However there are no examples, it just links to the schema definitions.

I think it would help to have something like this for each format: (or at least Text and possibly HTML?) Tokei Example

baron1405 commented 4 months ago

Excellent point! I will add output examples to that project. Please open an issue there so you can be notified once I add the examples. In the meantime, have a look at the reports used by the integration tests. They will show you an example of every type of report that the plugin generates. Start with the simple-project directory. It contains all six formats of report that the plugin can generate.

ccorneli commented 4 months ago

Great, yes, that's more like what I was looking for. Thanks.. I'll create the issue over there.