From 86f22f246562f39cd55d89dcbbff33c20767f14b Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Mon, 14 Jul 2025 18:23:09 +0100 Subject: [PATCH 1/3] .github/copilot-instructions.md --- ...nstructions.md => copilot-instructions.md} | 37 +++++++++++-------- devdoc/StyleGuide.md | 2 + 2 files changed, 24 insertions(+), 15 deletions(-) rename .github/{instructions/general.instructions.md => copilot-instructions.md} (54%) diff --git a/.github/instructions/general.instructions.md b/.github/copilot-instructions.md similarity index 54% rename from .github/instructions/general.instructions.md rename to .github/copilot-instructions.md index 3efcf5d1d7e..e7573a8b618 100644 --- a/.github/instructions/general.instructions.md +++ b/.github/copilot-instructions.md @@ -1,6 +1,3 @@ ---- -applyTo: "**" ---- # GitHub Copilot Instructions for HPCC Platform ## Repository Structure @@ -15,26 +12,19 @@ This repository contains **two distinct projects**: ### Build System - **Build tool**: CMake with Ninja generator - **Configuration**: Use options from `vcpkg-linux.code-workspace` -- **Key cmake arguments**: - ``` - -DCONTAINERIZED=OFF - -DUSE_OPTIONAL=OFF - -DUSE_CPPUNIT=ON - -DINCLUDE_PLUGINS=ON - -DSUPPRESS_V8EMBED=ON - -DSUPPRESS_REMBED=ON - ``` +- **Key cmake arguments**: deduce cmake arguments from .vscode/settings.json ### Build Commands +- **Build directory** (): Extract the current setting from "cmake.buildDirectory" in .vscode/settings.json which is based on $buildType ```bash # Configure the build -cmake -B ./build -S . -G Ninja -DCONTAINERIZED=OFF -DUSE_OPTIONAL=OFF -DUSE_CPPUNIT=ON -DINCLUDE_PLUGINS=ON -DSUPPRESS_V8EMBED=ON -DSUPPRESS_REMBED=ON -DCMAKE_BUILD_TYPE=Debug +cmake -B -S . -G Ninja -DCONTAINERIZED=OFF -DUSE_OPTIONAL=OFF -DUSE_CPPUNIT=ON -DINCLUDE_PLUGINS=ON -DSUPPRESS_V8EMBED=ON -DSUPPRESS_REMBED=ON -DCMAKE_BUILD_TYPE=Debug # Build -cmake --build ./build --parallel +cmake --build --parallel # Create package -cmake --build ./build --parallel --target package +cmake --build --parallel --target package ``` ### Key Directories @@ -53,6 +43,15 @@ cmake --build ./build --parallel --target package - Follow the style guide in `devdoc/StyleGuide.md` - Review guidelines in `devdoc/CodeReviews.md` - Submission process in `devdoc/CodeSubmissions.md` +- Never add trailing whitespace, be careful when copying code from other sources +- Use Allman style for C++ code blocks +- Do not use brace curly blocks for single line blocks, unless they are nested +- Use camel case for variable names +- Use constexpr's for constances not macros +- Use Owned vs Linked for assigning ownership of objects +- Avoid default parameters in function declarations (overload methods with different prototypes instead) +- Use `#pragma once` for header guards +- Use %u for unsigned integers, %d for signed integers ### Development Workflow - See `devdoc/Development.md` for testing and development guidelines @@ -66,3 +65,11 @@ For the ECL Watch web interface, see the separate instructions in `esp/src/.gith ## Documentation - Contributing docs: `devdoc/docs/ContributeDocs.md` - GitHub Copilot tips: `devdoc/userdoc/copilot/CopilotPromptTips.md` + +## Code Reviews +- Follow the guidelines in `devdoc/CodeReviews.md` +- When reviewing code, pay particular attention to the following questions: +- Are there any efficiency concerns? +- Is the code thread safe? +- Could the code be refactored to improve maintainability and reuse? +- Are there any memory or resource leaks? diff --git a/devdoc/StyleGuide.md b/devdoc/StyleGuide.md index 2c1dd9a89cd..ef769cbcd4b 100644 --- a/devdoc/StyleGuide.md +++ b/devdoc/StyleGuide.md @@ -358,3 +358,5 @@ MORE! Requiring more work: \* namespaces \* STL \* c++11 \* Review all documentation \* Better examples for shared + + From 4e517120578e4addd08501e46a1a2908b42446d7 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Mon, 14 Jul 2025 18:26:04 +0100 Subject: [PATCH 2/3] wip2 --- .github/copilot-instructions.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index e7573a8b618..e73eee50f6a 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -66,10 +66,10 @@ For the ECL Watch web interface, see the separate instructions in `esp/src/.gith - Contributing docs: `devdoc/docs/ContributeDocs.md` - GitHub Copilot tips: `devdoc/userdoc/copilot/CopilotPromptTips.md` -## Code Reviews +## When performing a code review - Follow the guidelines in `devdoc/CodeReviews.md` -- When reviewing code, pay particular attention to the following questions: -- Are there any efficiency concerns? -- Is the code thread safe? -- Could the code be refactored to improve maintainability and reuse? -- Are there any memory or resource leaks? +- Pay particular attention to the following questions: + - Are there any efficiency concerns? + - Is the code thread safe? + - Could the code be refactored to improve maintainability and reuse? + - Are there any memory or resource leaks? From 1d510bc635e016765363c97ad3063c785b40b2d1 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Mon, 14 Jul 2025 18:32:35 +0100 Subject: [PATCH 3/3] new code --- dali/daliadmin/daliadmin.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dali/daliadmin/daliadmin.cpp b/dali/daliadmin/daliadmin.cpp index 77614b01ecc..1b7719ab844 100644 --- a/dali/daliadmin/daliadmin.cpp +++ b/dali/daliadmin/daliadmin.cpp @@ -148,6 +148,31 @@ int main(int argc, const char* argv[]) return -1; } + unsigned *myvariablename = new unsigned; + *myvariablename = 10000; + printf("%d\n", *myvariablename); + + unsigned __int64 sum = 0; + // sum up all the numbers from 0 to 9999 + for (unsigned x=0; x<*myvariablename; x++) + { + sum += x; + } + printf("%llu\n", sum); + sum = 0; + // sum up all the numbers from 0 to 9999 N times + for (unsigned x=0; x<*myvariablename; x++) + { + for (unsigned y=0; y<*myvariablename; y++) + { + // nested loop + sum += x; + } + } + printf("%llu\n", sum); + + + Owned globals = loadConfiguration(defaultYaml, argv, "daliadmin", "DALIADMIN", "daliadmin.xml", nullptr, nullptr, false); Owned props = createProperties("daliadmin.ini"); StringArray params;