Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable "Documentation Comments" warning for selected files

Tags:

Xcode has the ability to check for Documentation Comments issues and report warnings when something is not quite right. For instance, I've added Facebook SDK to my project using CocoaPods. At some point in the file FBError.h there's the following code:

/*!  @typedef NS_ENUM (NSInteger, FBErrorCategory)   @abstract Indicates the Facebook SDK classification for the error   @discussion  */ 

Note that the @discussion parameter is empty, and Xcode will generate a warning accordingly:

Empty paragraph passed to '@discussion' command

However, Facebook SDK is not the only library I've added to my project, and the Issues tab is full of other documentation related warnings from 3rd party files, from the Pods I installed.

I'd like to know how to suppress this kind of warning for those files.

like image 297
Guilherme Avatar asked Jun 27 '14 13:06

Guilherme


1 Answers

You can use this snippet to suppress the warnings:

#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdocumentation"  #import <YourHeader.h>  #pragma clang diagnostic pop 

see this cocoapod-issue for details: https://github.com/CocoaPods/CocoaPods/issues/1481 (snippet comes from there)

like image 79
Thorsten Avatar answered Sep 20 '22 08:09

Thorsten