(codingstyle): sheldon deletes ifndef/endif
Summary
Sheldon remove #ifdef and/or #endif in .hpp (which are not header guards).
Steps to reproduce
With this exemple Aa.hpp
:
#pragma once
#include <fwCore/macros.hpp>
#include <fwCore/spyLog.hpp>
#ifdef CAMP_COMPILATION
#include <fwCamp/Mapper/AaMapper.hpp>
#endif
namespace fwA
{
class AA_CLASS_API Aa
{
public:
AA_API Aa(int& argc, char** argv);
bool doSomething(int val)
{
#ifndef _DEBUG
FwCoreNotUsedMacro(val);
#endif
OSLM_ASSERT("val: " << val, val > 0 );
}
};
} // namespace fwA
Sheldon generates :
#pragma once
#include <fwCore/macros.hpp>
#include <fwCore/spyLog.hpp>
#ifdef CAMP_COMPILATION
#include <fwCamp/Mapper/AaMapper.hpp>
namespace fwA
{
class AA_CLASS_API Aa
{
public:
AA_API Aa(int& argc, char** argv);
bool doSomething(int val)
{
FwCoreNotUsedMacro(val);
OSLM_ASSERT("val: " << val, val > 0 );
}
};
} // namespace fwA
Dev environment
- OS: Linux, Windows, MacOS
- Commit: current commit (4d37fa9b)
What is the current bug behavior?
In this example, sheldon deletes ifdef/endif
What is the expected correct behavior?
In this example, no "ifdef" should be deleted
Possible fixes
improve the regex to detect good ifdef/endif? Revert last MR?