Merge bitcoin/bitcoin#36961: ci: enable `readability-redundant-access-specifiers`
What changed, and why it matters
This commit only changes code style. It turns on a clang-tidy lint rule that flags repeated 'public:' or 'private:' labels that don't change access, then either removes those redundant labels or adds NOLINT comments to ignore them in Qt code that is planned for replacement. There is no functional change to Bitcoin Core's behavior, no bug fix, and no security impact.
No action needed; this is a code-style/linting change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The merge enables readability-redundant-access-specifiers in src/.clang-tidy and applies it across the tree. In non-Qt files (headerssync.h, util/subprocess.h, validation.cpp) redundant access-specifier labels are removed. In Qt headers, because Q_SLOTS/Q_SIGNALS macros implicitly change access and the Qt code is slated for replacement, the existing public/private labels are kept and annotated with // NOLINT(readability-redundant-access-specifiers). The diff is purely cosmetic/linting.
Changed components
src/.clang-tidysrc/headerssync.hsrc/qt/*.hsrc/qt/rpcconsole.cppsrc/util/subprocess.hsrc/validation.cppInspect captured patch +39 / −47
### src/.clang-tidy
@@ -45,6 +45,7 @@ performance-*,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-contains,
+readability-redundant-access-specifiers,
readability-redundant-declaration,
readability-redundant-string-init,
'
### src/headerssync.h
@@ -218,7 +218,6 @@ class HeadersSyncState
/** Return a set of headers that satisfy our proof-of-work threshold */
std::vector<CBlockHeader> PopHeadersReadyForAcceptance();
-private:
/** NodeId of the peer (used for log messages) **/
const NodeId m_id;
### src/qt/addressbookpage.h
@@ -44,7 +44,7 @@ class AddressBookPage : public QDialog
void setModel(AddressTableModel *model);
const QString &getReturnValue() const { return returnValue; }
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void done(int retval) override;
private:
@@ -58,7 +58,7 @@ public Q_SLOTS:
QString newAddressToSelect;
void updateWindowsTitleWithWalletName();
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
/** Delete currently selected address entry */
void on_deleteAddress_clicked();
/** Create a new address for receiving coins and / or add a new address book entry */
### src/qt/askpassphrasedialog.h
@@ -43,7 +43,7 @@ class AskPassphraseDialog : public QDialog
bool fCapsLock{false};
SecureString* m_passphrase_out;
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void textChanged();
void secureClearPassFields();
void toggleShowPassword(bool);
### src/qt/bantablemodel.h
@@ -68,7 +68,7 @@ class BanTableModel : public QAbstractTableModel
bool unban(const QModelIndex& index);
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void refresh();
private:
### src/qt/bitcoin.h
@@ -68,7 +68,7 @@ class BitcoinApplication: public QApplication
interfaces::Node& node() const { assert(m_node); return *m_node; }
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
/// Request core shutdown
void requestShutdown();
### src/qt/bitcoinamountfield.h
@@ -71,7 +71,7 @@ class BitcoinAmountField: public QWidget
AmountSpinBox* amount{nullptr};
QValueComboBox *unit;
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void unitChanged(int idx);
};
### src/qt/bitcoingui.h
@@ -350,7 +350,7 @@ class UnitDisplayStatusBarControl : public QLabel
/** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */
void createContextMenu();
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
/** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */
void updateDisplayUnit(BitcoinUnit newUnits);
/** Tells underlying optionsModel to update its current display unit. */
### src/qt/coincontroldialog.h
@@ -92,7 +92,7 @@ class CoinControlDialog : public QDialog
friend class CCoinControlWidgetItem;
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void showMenu(const QPoint &);
void copyAmount();
void copyLabel();
### src/qt/editaddressdialog.h
@@ -39,7 +39,7 @@ class EditAddressDialog : public QDialog
QString getAddress() const;
void setAddress(const QString &address);
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void accept() override;
private:
### src/qt/freespacechecker.h
@@ -37,7 +37,7 @@ class FreespaceChecker : public QObject
ST_ERROR
};
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void check();
Q_SIGNALS:
### src/qt/initexecutor.h
@@ -26,7 +26,7 @@ class InitExecutor : public QObject
explicit InitExecutor(interfaces::Node& node);
~InitExecutor();
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void initialize();
void shutdown();
### src/qt/intro.h
@@ -62,7 +62,7 @@ private Q_SLOTS:
void on_dataDirDefault_clicked();
void on_dataDirCustom_clicked();
-private:
+private: // NOLINT(readability-redundant-access-specifiers)
Ui::Intro *ui;
bool m_prune_checkbox_is_default{true};
QThread* thread{nullptr};
### src/qt/modaloverlay.h
@@ -32,7 +32,7 @@ class ModalOverlay : public QWidget
void showHide(bool hide = false, bool userRequested = false);
bool isLayerVisible() const { return layerIsVisible; }
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void toggleVisibility();
void closeClicked();
### src/qt/notificator.h
@@ -38,7 +38,7 @@ class Notificator: public QObject
Critical /**< An error occurred */
};
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
/** Show notification message.
@param[in] cls general message class
@param[in] title title shown with message
### src/qt/overviewpage.h
@@ -37,7 +37,7 @@ class OverviewPage : public QWidget
void setWalletModel(WalletModel *walletModel);
void showOutOfSyncWarning(bool fShow);
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void setBalance(const interfaces::WalletBalances& balances);
void setPrivacy(bool privacy);
@@ -59,7 +59,7 @@ public Q_SLOTS:
TxViewDelegate *txdelegate;
std::unique_ptr<TransactionFilterProxy> filter;
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void LimitTransactionRows();
void updateDisplayUnit();
void handleTransactionClicked(const QModelIndex &index);
### src/qt/peertablemodel.h
@@ -70,7 +70,7 @@ class PeerTableModel : public QAbstractTableModel
Qt::ItemFlags flags(const QModelIndex &index) const override;
/*@}*/
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void refresh();
private:
### src/qt/psbtoperationsdialog.h
@@ -27,7 +27,7 @@ class PSBTOperationsDialog : public QDialog
void openWithPSBT(PartiallySignedTransaction psbtx);
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void signTransaction();
void broadcastTransaction();
void copyToClipboard();
### src/qt/qrimagewidget.h
@@ -32,7 +32,7 @@ class QRImageWidget : public QLabel
bool setQR(const QString& data, const QString& text = "");
QImage exportImage();
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void saveImage();
void copyImage();
### src/qt/qvaluecombobox.h
@@ -27,7 +27,7 @@ class QValueComboBox : public QComboBox
private:
int role{Qt::UserRole};
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void handleSelectionChanged(int idx);
};
### src/qt/receivecoinsdialog.h
@@ -44,7 +44,7 @@ class ReceiveCoinsDialog : public QDialog
void setModel(WalletModel *model);
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void clear();
void reject() override;
void accept() override;
@@ -61,7 +61,7 @@ public Q_SLOTS:
QModelIndex selectedRow();
void copyColumnToClipboard(int column);
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void on_receiveButton_clicked();
void on_showRequestButton_clicked();
void on_removeRequestButton_clicked();
### src/qt/receiverequestdialog.h
@@ -31,7 +31,7 @@ private Q_SLOTS:
void on_btnCopyAddress_clicked();
void updateDisplayUnit();
-private:
+private: // NOLINT(readability-redundant-access-specifiers)
Ui::ReceiveRequestDialog *ui;
WalletModel* model{nullptr};
SendCoinsRecipient info;
### src/qt/recentrequeststablemodel.h
@@ -83,7 +83,7 @@ class RecentRequestsTableModel: public QAbstractTableModel
void addNewRequest(const std::string &recipient);
void addNewRequest(RecentRequestEntry &recipient);
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void updateDisplayUnit();
private:
### src/qt/rpcconsole.cpp
@@ -94,7 +94,7 @@ class RPCExecutor : public QObject
public:
explicit RPCExecutor(interfaces::Node& node) : m_node(node) {}
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void request(const QString &command, const QString& wallet_name);
Q_SIGNALS:
### src/qt/rpcconsole.h
@@ -195,7 +195,7 @@ public Q_SLOTS:
void updateWindowTitle();
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void updateAlerts(const QString& warnings);
};
### src/qt/sendcoinsdialog.h
@@ -53,7 +53,7 @@ class SendCoinsDialog : public QDialog
// Only used for testing-purposes
wallet::CCoinControl* getCoinControl() { return m_coin_control.get(); }
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void clear();
void reject() override;
void accept() override;
@@ -95,7 +95,7 @@ public Q_SLOTS:
void updateFeeMinimizedLabel();
void updateCoinControlState();
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void sendButtonClicked(bool checked);
void on_buttonChooseFee_clicked();
void on_buttonMinimizeFee_clicked();
@@ -143,7 +143,7 @@ private Q_SLOTS:
void countDown();
void updateButtons();
-private:
+private: // NOLINT(readability-redundant-access-specifiers)
QAbstractButton *yesButton;
QAbstractButton *m_psbt_button;
QTimer countDownTimer;
### src/qt/sendcoinsentry.h
@@ -49,7 +49,7 @@ class SendCoinsEntry : public QWidget
void setFocus();
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void clear();
void checkSubtractFeeFromAmount();
### src/qt/signverifymessagedialog.h
@@ -38,7 +38,7 @@ class SignVerifyMessageDialog : public QDialog
WalletModel* model{nullptr};
const PlatformStyle *platformStyle;
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
/* sign message */
void on_addressBookButton_SM_clicked();
void on_pasteButton_SM_clicked();
### src/qt/test/apptests.h
@@ -25,7 +25,7 @@ private Q_SLOTS:
void guiTests(BitcoinGUI* window);
void consoleTests(RPCConsole* console);
-private:
+private: // NOLINT(readability-redundant-access-specifiers)
//! Add expected callback name to list of pending callbacks.
void expectCallback(std::string callback) { m_callbacks.emplace(std::move(callback)); }
### src/qt/test/optiontests.h
@@ -24,7 +24,7 @@ private Q_SLOTS:
void parametersInteraction();
void extractFilter();
-private:
+private: // NOLINT(readability-redundant-access-specifiers)
interfaces::Node& m_node;
common::Settings m_previous_settings;
};
### src/qt/transactionview.h
@@ -92,7 +92,7 @@ class TransactionView : public QWidget
QList<TransactionDescDialog*> m_opened_dialogs;
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void contextualMenu(const QPoint &);
void dateRangeChanged();
void showDetails();
### src/qt/utilitydialog.h
@@ -32,7 +32,7 @@ class HelpMessageDialog : public QDialog
Ui::HelpMessageDialog *ui;
QString text;
-private Q_SLOTS:
+private Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
void on_okButton_accepted();
};
### src/qt/walletframe.h
@@ -65,7 +65,7 @@ class WalletFrame : public QFrame
WalletView* currentWalletView() const;
WalletModel* currentWalletModel() const;
-public Q_SLOTS:
+public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
/** Switch to overview (home) page */
void gotoOverviewPage();
/** Switch to history (transactions) page */
### src/util/subprocess.h
@@ -687,7 +687,6 @@ class Buffer
explicit Buffer(size_t cap) { buf.resize(cap); }
void add_cap(size_t cap) { buf.resize(cap); }
-public:
std::vector<char> buf;
size_t length = 0;
};
@@ -769,7 +768,7 @@ class Communication
Communication& operator=(const Communication&) = delete;
Communication(Communication&&) = default;
Communication& operator=(Communication&&) = default;
-public:
+
int send(const char* msg, size_t length);
int send(const std::vector<char>& msg);
@@ -784,7 +783,6 @@ class Communication
std::pair<OutBuffer, ErrBuffer> communicate_threaded(
const char* msg, size_t length);
-private:
Streams* stream_;
size_t out_buf_cap_ = DEFAULT_BUF_CAP_BYTES;
size_t err_buf_cap_ = DEFAULT_BUF_CAP_BYTES;
@@ -810,7 +808,6 @@ class Streams
Streams(Streams&&) = default;
Streams& operator=(Streams&&) = default;
-public:
void setup_comm_channels();
void cleanup_fds()
@@ -851,7 +848,7 @@ class Streams
void set_out_buf_cap(size_t cap) { comm_.set_out_buf_cap(cap); }
void set_err_buf_cap(size_t cap) { comm_.set_err_buf_cap(cap); }
-public: /* Communication forwarding API's */
+ /* Communication forwarding API's */
int send(const char* msg, size_t length)
{ return comm_.send(msg, length); }
@@ -864,9 +861,6 @@ class Streams
std::pair<OutBuffer, ErrBuffer> communicate(const std::vector<char>& msg)
{ return comm_.communicate(msg); }
-
-public:// Yes they are public
-
std::shared_ptr<FILE> input_ = nullptr;
std::shared_ptr<FILE> output_ = nullptr;
std::shared_ptr<FILE> error_ = nullptr;
@@ -996,7 +990,6 @@ class Popen
void populate_c_argv();
void execute_process() noexcept(false);
-private:
detail::Streams stream_;
#ifdef WIN32
### src/validation.cpp
@@ -711,7 +711,6 @@ class MemPoolAccept
return m_active_chainstate.m_chainman.m_validation_cache;
}
-private:
CTxMemPool& m_pool;
/** Holds a cached view of available coins from the UTXO set, mempool, and artificial temporary coins (to enable package validation).Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.