Open nilsvu opened 4 years ago
Re https://github.com/sxs-collaboration/spectre/pull/1817#discussion_r349952589:
deprecated
keywords, somehow retrieve the commit that added the keyword, retrieve the corresponding merge commit and compare its date).You're going to love this idea ;)
So we could have a macro roughly as follows:
/// MESSAGE is the deprecation message
/// DATE is the date on which this is being deprecated
#define DEPRECATED(MESSAGE, DATE) \
BOOST_PP_IF(BOOST_PP_GREATER(CURRENT_DATE,
DATE + 6 /* need to do some math here to get month right */),
static_assert(false, "remove deprecated code!");, [[deprecated, MESSAGE]])
This will cause compile failures six months after code is deprecated making it clear that the code has been deprecated long enough to be removed. The downside is that on the first of every month we could have builds break and someone needs to fix it, which is kind of annoying.
An alternative mechanism would be:
#define DEPRECATED(DATE, MESSAGE) [[deprecated, MESSAGE]]
and have a CI check run only on develop flag old code either by (in order of increasing difficulty):
Yay more macros :)
I knew you'd love it ;)
You can always hard-code a repo URL in the workflow and check the ${{ github.repository }}
against it. But I suppose the idea is that actions run on forks the same way they do on the base repo.
Feature request:
This issue is to discuss our policy for deprecating code. It came up in this comment thread: https://github.com/sxs-collaboration/spectre/pull/1817#discussion_r349931786
This is my suggestion from #1817:
deprecated
attribute instead of deleting code (see https://en.cppreference.com/w/cpp/language/attributes/deprecated).Component: