XCode does not show appledoc warnings #389

Closed
fuggly opened this Issue Aug 9, 2013 · 20 comments

Projects

None yet

4 participants

@fuggly
fuggly commented Aug 9, 2013

Hiyas

If this has already been answered or asked before, I apologize, but a quick search for "xcode warnings" hasn't really dug up much. Anyways, I am sure this is a configuration problem on my own, but I can't figure it out how to make it correctly.

What I want to do is to run appledoc and have it log everything it finds that isn't documented out so that XCode can pick it up when started using an Aggregate.

I managed to make appledoc working and producing happily documentation with this run script in the aggregate:

if [ -e "/usr/local/bin/appledoc" ]
then
/usr/local/bin/appledoc --create-html --install-docset --project-name "RMTXKit" --project-company "ABACUS Research AG" --company-id "ch.abacus" --output "/Users/misteli/dev/objc/iPhone/Libraries/RMTXKit/Documentation" --publish-docset –logformat=xcode --verbose xcode --keep-undocumented-objects --keep-undocumented-members --keep-intermediate-files --warn-undocumented-object --warn-undocumented-member --warn-empty-description --warn-unknown-directive --merge-categories --merge-category-comment --search-undocumented-doc --warn-missing-arg --no-repeat-first-par --no-warn-invalid-crossref --ignore "*.m" --ignore "*Test.h" --ignore "*Tests.h" --exit-threshold 2 --docset-package-url "http://www.abacus.ch/docs" --docset-feed-url "http://www.abacus.ch/docs" /Users/misteli/dev/objc/iPhone/Libraries/RMTXKit
fi

I experimented around using the $(PROJECTNAME) variables and more, but for the sake of being able to quickly run it in the console, this current version doesn't use that.

So.. this builds up all my documentation but it doesn't log anything that isn't documented. Also, if I simply copy/paste the call to a console, appledoc happily runs, creates the documentation but whilst its running it doesn't log anything out other than its version and build number.

What did I forget to add?

Thanks!

Owner
tomaz commented Aug 9, 2013

It was a while since I was in this part of the project, so answering from memory. It might be --keep-undocumented-xxxx options that prevent logging out stuff, did you try using your cmd line without them?

Collaborator

Do you run Appledoc from inside xcode?

Op 9 aug. 2013 om 13:45 heeft tomaz notifications@github.com het volgende geschreven:

It was a while since I was in this part of the project, so answering from memory. It might be --keep-undocumented-xxxx options that prevent logging out stuff, did you try using your cmd line without them?


Reply to this email directly or view it on GitHub.

fuggly commented Aug 9, 2013

Yup, tried that too, but no warnings. I'm using appledoc 2.1, build 858. I'm quiet sure it has something to do with any of my switches cancelling each other or so, but I can't find what it is.

Collaborator

Afaik, warnings will not show on the commandline, only when running as a build task.

Op 9 aug. 2013 om 14:25 heeft fuggly notifications@github.com het volgende geschreven:

Yup, tried that too, but no warnings. I'm using appledoc 2.1, build 858. I'm quiet sure it has something to do with any of my switches cancelling each other or so, but I can't find what it is.


Reply to this email directly or view it on GitHub.

fuggly commented Aug 9, 2013

I think I found it.. if I use

--verbose xcode

it doesn't log anything. If I use

--verbose 2

it seems to work though. I remember that some times before when I stumbled the first time over appledoc, there was a wonderful site with descriptions on various tags and how they look in the generated documentation. I don't remember if the valid switches were explained as well, but did that link sink forever or is it planned to have it online again one time?

Collaborator

Also, i know my version of switches work: simplicate.weebly.com

Op 9 aug. 2013 om 14:25 heeft fuggly notifications@github.com het volgende geschreven:

Yup, tried that too, but no warnings. I'm using appledoc 2.1, build 858. I'm quiet sure it has something to do with any of my switches cancelling each other or so, but I can't find what it is.


Reply to this email directly or view it on GitHub.

Collaborator

Would you mind adding an issue for this on github? A better handling of commandline params has its benefits

Op 9 aug. 2013 om 14:34 heeft fuggly notifications@github.com het volgende geschreven:

I think I found it.. if I use

--verbose xcode

it doesn't log anything. If I use

--verbose 2

it seems to work though. I remember that some times before when I stumbled the first time over appledoc, there was a wonderful site with descriptions on various tags and how they look in the generated documentation. I don't remember if the valid switches were explained as well, but did that link sink forever or is it planned to have it online again one time?


Reply to this email directly or view it on GitHub.

fuggly commented Aug 9, 2013

@robvdveer funny enough, but your version of the command line parameters indeed work correctly. What I'm wondering is why mine don't (--verbose xcode vs --verbose 2 when I use my version of the script). Anways.. will change to your version and adopt parameters accordingly as how I need them. Thanks!
Uhm.. btw.. well.. I can add an issue, but I don't really know what for. I mean.. is this a bug in the command line parsing code of appledoc (no offense but I found that snippet pretty weird to understand) or can you see something wierd in my version of the script?

Collaborator

Just put up an issue that --verbose xcode gives strange results and i'll pick it up after the weekend. (Yes i am confused by the code as well)

Op 9 aug. 2013 om 14:59 heeft fuggly notifications@github.com het volgende geschreven:

@robvdveer funny enough, but your version of the command line parameters indeed work correctly. What I'm wondering is why mine don't (--verbose xcode vs --verbose 2 when I use my version of the script). Anways.. will change to your version and adopt parameters accordingly as how I need them. Thanks!
Uhm.. btw.. well.. I can add an issue, but I don't really know what for. I mean.. is this a bug in the command line parsing code of appledoc (no offense but I found that snippet pretty weird to understand) or can you see something wierd in my version of the script?


Reply to this email directly or view it on GitHub.

fuggly commented Aug 9, 2013

@robvdveer Well yes, but isn't this here already an open issue or do you want me to close this one and open a separate one for the --verbose flag?

Collaborator

Never mind... I thought we were on google groups

Op 9 aug. 2013 om 15:17 heeft fuggly notifications@github.com het volgende geschreven:

@robvdveer Well yes, but isn't this here already an open issue or do you want me to close this one and open a separate one for the --verbose flag?


Reply to this email directly or view it on GitHub.

@robvdveer robvdveer pushed a commit to robvdveer/appledoc that referenced this issue Sep 5, 2013
robvdveer Added fix for invalid verbose level setting, refers to issue #389 4d232ec

Thanks @robvdveer

It looks like the fix for that problem surfaced my issue. I guess the proper plist type for the --version property is String since the appledoc help indicates that "xcode" is a possible value:

--verbose Log verbosity level [0-6,xcode]

But the example AppledocSettings.plist file shows verbose as a Number.

So I'm thinking that anyone using the sample is going to fail.

Collaborator

My pull request merely added a warning if the argument was not numeric, it didn't change a thing about the handling... But i might be missing something as i just woke up.

http://simplicate.weebly.com

On Wed, Sep 11, 2013 at 8:55 AM, dmcgloin notifications@github.com
wrote:

Thanks @robvdveer
It looks like the fix for that problem surfaced my issue. I guess the proper plist type for the --version property is String since the appledoc help indicates that "xcode" is a possible value:
--verbose Log verbosity level [0-6,xcode]
But the example AppledocSettings.plist file shows verbose as a Number.

So I'm thinking that the anyone using the sample is going to fail.

Reply to this email directly or view it on GitHub:
#389 (comment)

Took a look again at the code change. I'm fairly confident that the code change has a bug. You should be able to reproduce the problem by using the example AppledocSettings.plist in the distribution. Since the data type for the '--verbose' flag property is Integer, and the code assumes that self.verbose is a String, it blows up on line 380:

if ([[NSScanner scannerWithString:self.verbose] scanInt:NULL] == false)
Collaborator

self.verbose is declared in GbAppleDocApplication as NSString (https://github.com/tomaz/appledoc/blob/master/Application/GBAppledocApplication.m)

@property (assign) NSString *verbose;

Therefore the test is correct.It has always been a string, and my patch merely verifies that the string is numeric in any way. Perhaps i missed a bit, but i surely tested it. Later on, this string is passed into the logger

    [GBLog setLogLevelFromVerbose:self.verbose];

All these definitions have not been touched for a long while.

Fair enough. But using the example AppledocSettings.plist from the distribution crashes. I'm thinking this is a problem that should somehow be fixed.

The code before your change allowed a --verbose Integer type in the plist file. Now it crashes.

Perhaps I'm wrong, but I don't know how a test could have been run with the example AppledocSettings.plist and a crash not observed.

The example plist could be changed, but everyone who has already created a customized AppledocSettings.plist will crash until they change the data type of the --verbose property to String. Unfortunately, detecting that this is the cause is fairly involved - I had to debug through the source to see the problem.

So, someone could remove or alter your fix. Or force people to update their AppledocSettings.plist files (and change the example one). It's one or the other. For me, I chose the easy way - update my AppledocSettings.plist.

Btw, I'm still confused. Is "xcode" no longer a valid value for the --verbose flag? Is the documentation wrong or the code?

Collaborator

I'll fix it so either way should NOT make Appledoc crash. Supported or not.

I don't know the history, but i know about the issue that using 'verbose xcode' never has worked, and silently assumed a loglevel of 0. How is was documented, i don't know, but from the source it silently suppressed all warnings. That's why i added the check to verify if ts numeric or not. 





I think it fails because even though the property is declared as NSString, the plist parser just assigns a NSNumber pointer to it (oh god how i love strong typing) which is ok in Objective C, but a big no-no in my programming practice. 





Clearly there is a discrepancy between definition of the parameter and the plist that should be sorted.





I'm not behind a computer right now, but i suggest to fix it with:





    If([self.verbose isKindOfClass:[NSString class]] && [NSScanner.....





This would fix the crash if self.verbose is not a string.








            if ([[NSScanner scannerWithString:self.verbose] scanInt:NULL] == fals





—

http://simplicate.weebly.com

On Thu, Sep 12, 2013 at 8:38 PM, dmcgloin notifications@github.com
wrote:

Fair enough. But using the example AppledocSettings.plist from the distribution crashes. I'm thinking this is a problem that should somehow be fixed.
The code before your change allowed a --verbose Integer type in the plist file. Now it crashes.
Perhaps I'm wrong, but I don't know how a test could have been run with the example AppledocSettings.plist and a crash not observed.
The example plist could be changed, but everyone who has already created a customized AppledocSettings.plist will crash until they change the data type of the --verbose property to String. Unfortunately, detecting that this is the cause is fairly involved - I had to debug through the source to see the problem.
So, someone could remove or alter your fix. Or force people to update their AppledocSettings.plist files (and change the example one). It's one or the other. For me, I chose the easy way - update my AppledocSettings.plist.

Btw, I'm still confused. Is "xcode" no longer a valid value for the --verbose flag? Is the documentation wrong or the code?

Reply to this email directly or view it on GitHub:
#389 (comment)

Owner
tomaz commented Nov 22, 2013

Set to fix this but would need to convert the project to ARC first...

Owner
tomaz commented Nov 25, 2013

Should be fixed with latest update.

Owner
tomaz commented May 16, 2014

Closing the issue - seems to be allright now? Feel free to reopen otherwise!

@tomaz tomaz closed this May 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment