Is there any way to configure the clang-format
tool to skip my Qt::connect
function calls ? There are several connects in my constructors which looks like these:
connect( m_Job, SIGNAL( error( const QString&, const QString& ) ), this, SLOT( onError( const QString&, const QString& ) ) );
connect( m_Job, SIGNAL( message( const QString& ) ), this, SLOT( onMessage( const QString& ) ) );
connect( m_Job, SIGNAL( progress( int, int ) ), this, SLOT( onProgress( int, int ) ) );
but after I run the formatting tool it makes it less readable:
connect( m_Job, SIGNAL( error(const QString&, const QString&)), this, SLOT( onError(const QString&, const QString&)) );
connect( m_Job, SIGNAL( message(const QString&)), this, SLOT( onMessage(const QString&)) );
connect( m_Job, SIGNAL( progress(int, int)), this, SLOT( onProgress(int, int)) );
Use // clang-format off
and // clang-format on
to make it skip code sections.
// clang-format off
// Don't touch this!
connect( m_Job, SIGNAL( error( const QString&, const QString& ) ), this, SLOT( onError( const QString&, const QString& ) ) );
connect( m_Job, SIGNAL( message( const QString& ) ), this, SLOT( onMessage( const QString& ) ) );
connect( m_Job, SIGNAL( progress( int, int ) ), this, SLOT( onProgress( int, int ) ) );
// clang-format on
// Carry on formatting