Skip to content

Commit 4cd2bd4

Browse files
fix(lint): clear clang-tidy warnings in authored code
Give small enums an explicit uint8_t base, drop misplaced const on Win32 handle typedefs, add override/nullptr in PreferencesDialog and DockedEditor, and NOLINT the CREATE_SETTING statics. README notes Anthropic LLM, tree-folder AI spawn, and dock-tab close. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5ce29c6 commit 4cd2bd4

11 files changed

Lines changed: 31 additions & 21 deletions

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ You shouldn't have to leave your editor to talk to an AI, run git, or open a she
88

99
### AI agents
1010

11-
NotepadAI speaks the Agent Client Protocol (ACP) over stdio. Claude Code and Codex are built in. Add any other ACP-compatible agent — Gemini, Auggie, or your own command — from Settings. Agents read and write files, run terminal commands, and see your workspace context, so they work on the same code you do.
11+
NotepadAI speaks the Agent Client Protocol (ACP) over stdio. Claude Code and Codex are built in. Add any other ACP-compatible agent — Gemini, Auggie, or your own command — from Settings. Agents read and write files, run terminal commands, and see your workspace context, so they work on the same code you do. Start a session from the AI menu or by right-clicking a folder in the file tree.
1212

13-
There's also a Goal Agent: pick an ACP judge (Claude Code, Codex, Opencode) or a Custom API endpoint that speaks Anthropic's Messages API. You set success criteria and it drives the working agent until they hold. And when you commit, AI can write the commit message from your staged diff. The protocol details and how to wire up a custom ACP agent are in [doc/AcpAgents.md](doc/AcpAgents.md).
13+
There's also a Goal Agent: pick an ACP judge (Claude Code, Codex, Opencode) or a Custom API endpoint that speaks Anthropic's Messages API. You set success criteria and it drives the working agent until they hold. And when you commit, AI can write the commit message from your staged diff — that generator (and other LLM calls) can talk to an OpenAI-compatible endpoint or Anthropic's Messages API. The protocol details and how to wire up a custom ACP agent are in [doc/AcpAgents.md](doc/AcpAgents.md).
1414

1515
### Git, built in
1616

@@ -22,7 +22,7 @@ A full PTY terminal built on libvterm and libptyqt, with mouse reporting and a s
2222

2323
### The editor itself
2424

25-
It's still Notepad++ at heart: a tabbed, splittable interface (Qt Advanced Docking System) with syntax highlighting for 80+ languages through vendored Scintilla and Lexilla. Macro recording and playback, session management, and an embedded Lua scripting layer are all here. If you're coming from Notepad++, it imports your config and sessions. There's also an editor minimap, live preview for Markdown and HTML, and a find-in-folder search that scans workspace directories with regex support.
25+
It's still Notepad++ at heart: a tabbed, splittable interface (Qt Advanced Docking System) with syntax highlighting for 80+ languages through vendored Scintilla and Lexilla. Right-click a panel tab to close it or its neighbors. Macro recording and playback, session management, and an embedded Lua scripting layer are all here. If you're coming from Notepad++, it imports your config and sessions. There's also an editor minimap, live preview for Markdown and HTML, and a find-in-folder search that scans workspace directories with regex support.
2626

2727
### Extras worth knowing
2828

‎src/ApplicationSettings.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ ApplicationSettings::ApplicationSettings(QObject *parent)
4242
{
4343
}
4444

45+
// File-scope ApplicationSetting<T> objects and by-value QString setters are the
46+
// established CREATE_SETTING shape. QString's constructor is not noexcept, and
47+
// the setter copies — neither is a hot path (settings load once / write on
48+
// change). NOLINT covers the whole expansion rather than rewriting the macro.
49+
// NOLINTBEGIN(bugprone-throwing-static-initialization,performance-unnecessary-value-param)
4550
CREATE_SETTING(Gui, ShowMenuBar, showMenuBar, bool, true)
4651
CREATE_SETTING(Gui, ShowToolBar, showToolBar, bool, true)
4752
CREATE_SETTING(Gui, ShowTabBar, showTabBar, bool, true)
@@ -169,11 +174,6 @@ static QString defaultCommitMessagePromptTemplate()
169174
"```\n");
170175
}
171176

172-
// CREATE_SETTING expands to a by-value QString setter, matching the existing
173-
// project idiom used by every other QString setting above. Suppressed here so
174-
// we don't drift from the established macro pattern (changing the macro is
175-
// out of scope and would noisily diff every preexisting QString setting).
176-
// NOLINTBEGIN(performance-unnecessary-value-param)
177177
CREATE_SETTING(Ai, CommitMessageProviderUrl, commitMessageProviderUrl, QString, QStringLiteral(""))
178178
CREATE_SETTING(Ai, CommitMessageModel, commitMessageModel, QString, QStringLiteral(""))
179179
CREATE_SETTING(Ai, CommitMessageApiFormat, commitMessageApiFormat, ApplicationSettings::AiApiFormatEnum, ApplicationSettings::OpenAiCompatible)
@@ -185,9 +185,9 @@ CREATE_SETTING(Ai, CommitMessageDiffByteBudget, commitMessageDiffByteBudget, int
185185
CREATE_SETTING(Ai, CommitMessageRulesByteBudget, commitMessageRulesByteBudget, int, 4000)
186186
CREATE_SETTING(Ai, CommitMessageStreamIdleTimeoutSec, commitMessageStreamIdleTimeoutSec, int, 60)
187187
CREATE_SETTING(Ai, CommitMessageGenerateShortcut, commitMessageGenerateShortcut, QString, QStringLiteral("Ctrl+Alt+G"))
188-
// NOLINTEND(performance-unnecessary-value-param)
189188

190189
CREATE_SETTING(Ai, SyncWorkspaceOnAiSwitch, syncWorkspaceOnAiSwitch, bool, true)
190+
// NOLINTEND(bugprone-throwing-static-initialization,performance-unnecessary-value-param)
191191

192192
// --- AI / ACP agent settings ---------------------------------------------------
193193
//

‎src/ApplicationSettings.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ApplicationSettings : public QSettings
7070
public:
7171
explicit ApplicationSettings(QObject *parent = nullptr);
7272

73-
enum DefaultDirectoryBehaviorEnum {
73+
enum DefaultDirectoryBehaviorEnum : std::uint8_t {
7474
FollowCurrentDocument,
7575
RememberLastUsed,
7676
HardCoded

‎src/DockedEditor.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int centerTabMaxWidth(const QWidget *tab)
5656
class DockedEditorComponentsFactory : public ads::CDockComponentsFactory
5757
{
5858
public:
59-
ads::CDockAreaTitleBar* createDockAreaTitleBar(ads::CDockAreaWidget* DockArea) const {
59+
ads::CDockAreaTitleBar* createDockAreaTitleBar(ads::CDockAreaWidget* DockArea) const override {
6060
DockedEditorTitleBar *titleBar = new DockedEditorTitleBar(DockArea);
6161

6262
// Disable the built in context menu for the title bar since it has options we don't want

‎src/EmbeddedWindowController.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <cstdint>
11+
1012
#include <QList>
1113
#include <QObject>
1214
#include <QString>
@@ -64,7 +66,7 @@ class EmbeddedWindowController : public QObject
6466
void allEmbedsReleased();
6567

6668
protected:
67-
enum class ReleaseMode { RestoreExact, FailSafeDetach };
69+
enum class ReleaseMode : std::uint8_t { RestoreExact, FailSafeDetach };
6870

6971
struct Embed {
7072
quintptr token = 0;

‎src/EmbeddedWindowWin32.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bool setLong(HWND hwnd, int index, LONG_PTR value)
2323
bool setParent(HWND hwnd, HWND parent)
2424
{
2525
SetLastError(ERROR_SUCCESS);
26-
const HWND previous = SetParent(hwnd, parent);
26+
HWND previous = SetParent(hwnd, parent);
2727
return previous != nullptr || GetLastError() == ERROR_SUCCESS;
2828
}
2929

@@ -174,7 +174,7 @@ bool restoreExact(const NativeWindowState &s, quintptr token)
174174
MapWindowPoints(HWND_DESKTOP, reinterpret_cast<HWND>(s.originalParent),
175175
reinterpret_cast<POINT *>(&rect), 2);
176176
if (sameWindow(s, token)) {
177-
const HWND z = (s.originalExStyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_NOTOPMOST;
177+
HWND z = (s.originalExStyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_NOTOPMOST;
178178
SetWindowPos(hwnd, z, rect.left, rect.top, rect.right - rect.left,
179179
rect.bottom - rect.top, SWP_NOACTIVATE | SWP_FRAMECHANGED);
180180
}
@@ -248,7 +248,7 @@ SyncResult syncGeometry(quintptr targetHandle, quintptr hostHandle, quintptr tok
248248
#ifdef Q_OS_WIN
249249
HWND target = reinterpret_cast<HWND>(targetHandle);
250250
HWND host = reinterpret_cast<HWND>(hostHandle);
251-
const HANDLE mark = reinterpret_cast<HANDLE>(token);
251+
HANDLE mark = reinterpret_cast<HANDLE>(token);
252252
const auto ownsTarget = [target, mark]() {
253253
return IsWindow(target) && GetPropW(target, EmbedPropertyName) == mark;
254254
};

‎src/EmbeddedWindowWin32.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <cstdint>
11+
1012
#include <QList>
1113
#include <QString>
1214
#include <QtGlobal>
@@ -56,7 +58,7 @@ struct NativeWindowState {
5658
};
5759

5860
// Result of re-syncing the foreign child's geometry to its host client area.
59-
enum class SyncResult {
61+
enum class SyncResult : std::uint8_t {
6062
Ok, // reparented (if asked) and resized successfully
6163
TransientError, // a Win32 call failed but the window still looks alive
6264
WindowLost, // the window is gone or the token no longer matches

‎src/PendingCloseState.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77

88
#pragma once
99

10+
#include <cstdint>
11+
1012
// Tiny, allocation-free state machine shared by MainWindow and unit tests.
1113
// It guarantees one outstanding close intent, at most one queued retry, and
1214
// exactly-once acceptance (notably exactly one restart process launch).
1315
class PendingCloseState
1416
{
1517
public:
16-
enum class Intent { None, Exit, Restart };
18+
enum class Intent : std::uint8_t { None, Exit, Restart };
1719

1820
void begin(Intent intent)
1921
{

‎src/dialogs/MainWindow.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#ifndef MAINWINDOW_H
2121
#define MAINWINDOW_H
2222

23+
#include <cstdint>
24+
2325
#include <QMainWindow>
2426
#include <QLabel>
2527
#include <QActionGroup>
@@ -301,7 +303,7 @@ private slots:
301303
// Persist a single snapshot (mid-session dock close path).
302304
void persistOneWorkspaceState(const WorkspaceStateSnapshot &snapshot) const;
303305

304-
enum class UserSaveAction { SaveAll, DiscardAll, Cancel };
306+
enum class UserSaveAction : std::uint8_t { SaveAll, DiscardAll, Cancel };
305307
UserSaveAction promptForSave(const QVector<ScintillaNext *> &editors);
306308

307309
void saveSettings() const;

‎src/dialogs/PreferencesDialog.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class PreferencesDialog : public QDialog
3838
Q_OBJECT
3939

4040
public:
41-
PreferencesDialog(ApplicationSettings *settings, QWidget *parent = 0);
42-
~PreferencesDialog();
41+
PreferencesDialog(ApplicationSettings *settings, QWidget *parent = nullptr);
42+
~PreferencesDialog() override;
4343

4444
void showApplicationRestartRequired() const;
4545

0 commit comments

Comments
 (0)