blackducksoftware / ohcount

The Ohloh source code line counter
https://github.com/blackducksoftware/ohcount
GNU General Public License v2.0
261 stars 69 forks source link

Try harder to disambiguate Puppet from Pascal #42

Closed raphink closed 7 years ago

raphink commented 9 years ago

These two constructs are considered Puppet code:

class <word> (

and

include <word>
raphink commented 9 years ago

@PeterDP ping

PDegenPortnoy commented 9 years ago

@raphink Thanks for the ping. We are embarrassingly behind on reviewing Ohcount pull requests and will not let yours languish.

raphink commented 9 years ago

No problem. I know how hard it is to keep up with that.

raphink commented 8 years ago

@PeterDP any news?

raphink commented 7 years ago

Is this still alive?

PDegenPortnoy commented 7 years ago

Yes it is!!!

We are working on a different PR, and others are starting to percolate up to the top.

PDegenPortnoy commented 7 years ago

I have added a ticket to the top of our backlog to review this and take action.

raphink commented 7 years ago

Ok, thanks for the heads up.

PDegenPortnoy commented 7 years ago

Thanks again for the re-ping

PDegenPortnoy commented 7 years ago

@raphink We've scoped the ticket to review the PR and have decided that we would like a test to show the improved functionality. Do you have an example of some Puppet code that was being mis-identified as Pascal that we could include in our test? That would help us merge and close.

raphink commented 7 years ago

@PDegenPortnoy besides what I listed in the PR description, not really.

notalex commented 7 years ago

@raphink, we modified the tests to add include and class declarations in pascal test files(https://github.com/blackducksoftware/ohcount/commit/780da1b0c4d4c214bc47293496500f7e1ccb940d). This change was made upon the master branch's code and the tests are passing. https://github.com/blackducksoftware/ohcount/commits/OTWO-4920

If you can provide us with some sample pascal code that is being incorrectly detected as puppet, it will help us to investigate this better.

raphink commented 7 years ago

@notalex I never write Pascal code. What I have seen however was Puppet code detected as Pascal.

notalex commented 7 years ago

@raphink, I have added some include & class constructs to puppet test files https://github.com/blackducksoftware/ohcount/commit/d57935f6a6a6547ac1371db5c83049a0f3f82919.

The tests are passing with the current master branch's code: https://github.com/blackducksoftware/ohcount/commits/OTWO-4920.

It is possible that the Puppet code you encountered might have some other constructs that caused it to be detected as Pascal. I will run the current master build against some open source puppet code to see if it fails.

raphink commented 7 years ago

https://www.openhub.net/p/puppet-postfix for example says the project contains some Pascal code.

notalex commented 7 years ago

I found 2 files being incorrectly detected as pascal for the puppet-postfix source. I can now write tests for these patterns. @raphink, your fix was spot on and we greatly appreciate your patience in tracking down this issue. I will be adding tests in another PR.

notalex commented 7 years ago

It will take us 2-3 days to deploy this change and get the puppet-postfix project updated on OpenHub.

raphink commented 7 years ago

Thanks