Skip to content

Commit f25c65d

Browse files
authored
Code review and CoPilot instructions update (#577)
1 parent a128730 commit f25c65d

20 files changed

Lines changed: 92 additions & 33 deletions

.azuredevops/pipelines/DirectXTK-GitHub-CMake-Dev17.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ variables:
5757
Codeql.Enabled: false
5858
VS_GENERATOR: 'Visual Studio 17 2022'
5959
WIN10_SDK: '10.0.19041.0'
60-
WIN11_SDK: '10.0.22000.0'
60+
WIN11_SDK: '10.0.26100.0'
6161

6262
pool:
6363
vmImage: windows-2022

.azuredevops/pipelines/DirectXTK-GitHub-CMake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ variables:
5757
Codeql.Enabled: false
5858
VS_GENERATOR: 'Visual Studio 17 2022'
5959
WIN10_SDK: '10.0.19041.0'
60-
WIN11_SDK: '10.0.22000.0'
60+
WIN11_SDK: '10.0.26100.0'
6161

6262
pool:
6363
vmImage: windows-2022

.azuredevops/pipelines/DirectXTK-GitHub-MinGW.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ variables:
7777
- name: VCPKG_MANIFEST_DIR
7878
value: '$(Build.SourcesDirectory)/build'
7979
- name: WIN11_SDK
80-
value: '10.0.22000.0'
80+
value: '10.0.26100.0'
8181
- name: BASE_URL
8282
value: https://github.com/brechtsanders/winlibs_mingw/releases/download
8383
- name: URL_MINGW32
@@ -90,6 +90,7 @@ variables:
9090
jobs:
9191
- job: MINGW32_BUILD
9292
displayName: 'Minimalist GNU for Windows (MinGW32)'
93+
timeoutInMinutes: 30
9394
steps:
9495
- checkout: self
9596
clean: true
@@ -178,6 +179,7 @@ jobs:
178179

179180
- job: MINGW64_BUILD
180181
displayName: 'Minimalist GNU for Windows (MinGW-W64) BUILD_TESTING=ON'
182+
timeoutInMinutes: 90
181183
steps:
182184
- checkout: self
183185
clean: true

.azuredevops/pipelines/DirectXTK-OneFuzz-Audio.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
3232
variables:
3333
Codeql.Enabled: false
3434
VS_GENERATOR: 'Visual Studio 17 2022'
35-
WIN11_SDK: '10.0.22000.0'
35+
WIN11_SDK: '10.0.26100.0'
3636

3737
pool:
3838
vmImage: windows-2022

.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
3232
variables:
3333
Codeql.Enabled: false
3434
VS_GENERATOR: 'Visual Studio 17 2022'
35-
WIN11_SDK: '10.0.22000.0'
35+
WIN11_SDK: '10.0.26100.0'
3636

3737
pool:
3838
vmImage: windows-2022

.azuredevops/pipelines/DirectXTK-OneFuzz.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
3232
variables:
3333
Codeql.Enabled: false
3434
VS_GENERATOR: 'Visual Studio 17 2022'
35-
WIN11_SDK: '10.0.22000.0'
35+
WIN11_SDK: '10.0.26100.0'
3636

3737
pool:
3838
vmImage: windows-2022

.github/copilot-instructions.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ These instructions define how GitHub Copilot should assist with this project. Th
2323
- **Documentation**: The project provides documentation in the form of wiki pages available at [Documentation](https://github.com/microsoft/DirectXTK/wiki/).
2424
- **Error Handling**: Use C++ exceptions for error handling and uses RAII smart pointers to ensure resources are properly managed. For some functions that return HRESULT error codes, they are marked `noexcept`, use `std::nothrow` for memory allocation, and should not throw exceptions.
2525
- **Testing**: Unit tests for this project are implemented in this repository [Test Suite](https://github.com/walbourn/directxtktest/) and can be run using CTest per the instructions at [Test Documentation](https://github.com/walbourn/directxtktest/wiki).
26-
- **Security**: This project uses secure coding practices from the Microsoft Secure Coding Guidelines, and is subject to the `SECURITY.md` file in the root of the repository. Functions that read input from image file, geometry files, and audio files are subject to OneFuzz testing to ensure they are secure against malformed files.
26+
- **Security**: This project uses secure coding practices from the Microsoft Secure Coding Guidelines, and is subject to the `SECURITY.md` file in the root of the repository. Functions that read input from image file, geometry files, and audio files are subject to OneFuzz fuzz testing to ensure they are secure against malformed files.
2727
- **Dependencies**: The project uses CMake and VCPKG for managing dependencies, making optional use of DirectXMath, GameInput, and XAudio2Redist. The project can be built without these dependencies, relying on the Windows SDK for core functionality.
2828
- **Continuous Integration**: This project implements GitHub Actions for continuous integration, ensuring that all code changes are tested and validated before merging. This includes building the project for a number of configurations and toolsets, running a subset of unit tests, and static code analysis including GitHub super-linter, CodeQL, and MSVC Code Analysis.
2929
- **Code of Conduct**: The project adheres to the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). All contributors are expected to follow this code of conduct in all interactions related to the project.
@@ -65,12 +65,13 @@ Tests/ # Tests are designed to be cloned from a separate repository at
6565

6666
## References
6767

68+
- [Source git repository on GitHub](https://github.com/microsoft/DirectXTK.git)
69+
- [DirectXTK documentation git repository on GitHub](https://github.com/microsoft/DirectXTK.wiki.git)
70+
- [DirectXTK test suite git repository on GitHub](https://github.com/walbourn/directxtktest.wiki.git).
6871
- [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines)
6972
- [Microsoft Secure Coding Guidelines](https://learn.microsoft.com/en-us/security/develop/secure-coding-guidelines)
7073
- [CMake Documentation](https://cmake.org/documentation/)
71-
- [VCPK Documentation](https://learn.microsoft.com/vcpkg/)
72-
- [DirectX Tool Kit for DirectX 11 Wiki](https://github.com/microsoft/DirectXTK/wiki/)
73-
- [DirectX Tool Kit for Audio Wiki](https://github.com/Microsoft/DirectXTK/wiki/Audio)
74+
- [VCPKG Documentation](https://learn.microsoft.com/vcpkg/)
7475
- [Games for Windows and the DirectX SDK blog - March 2012](https://walbourn.github.io/directxtk/)
7576
- [Games for Windows and the DirectX SDK blog - January 2013](https://walbourn.github.io/directxtk-update/)
7677
- [Games for Windows and the DirectX SDK blog - December 13](https://walbourn.github.io/directx-tool-kit-for-audio/)
@@ -107,3 +108,28 @@ When creating documentation:
107108
- Review each documented item against source code whenever related to the task.
108109
- Remove any speculative content.
109110
- Ensure all documentation is verifiable against the current state of the codebase.
111+
112+
## Code Review Instructions
113+
114+
When reviewing code, focus on the following aspects:
115+
116+
- Adherence to coding standards defined in `.editorconfig` and on the [wiki](https://github.com/microsoft/DirectXTK/wiki/Implementation).
117+
- Make coding recommendations based on the *C++ Core Guidelines*.
118+
- Proper use of RAII and smart pointers.
119+
- Correct error handling practices and C++ Exception safety.
120+
- Clarity and maintainability of the code.
121+
- Adequate comments where necessary.
122+
- Public interfaces are located in `Inc\*.h` should be clearly defined and documented on the GitHub wiki.
123+
- Compliance with the project's architecture and design patterns.
124+
- Ensure that all public functions and classes are covered by unit tests located on [GitHub](https://github.com/walbourn/directxtktest.git) where applicable. Report any gaps in test coverage.
125+
- Check for performance implications, especially in geometry processing algorithms.
126+
- Provide brutally honest feedback on code quality, design, and potential improvements as needed.
127+
128+
## Documentation Review Instructions
129+
130+
When reviewing documentation, do the following:
131+
132+
- Read the code located in [this git repository](https://github.com/microsoft/DirectXTK.git) in the main branch.
133+
- Review the public interface defined in the `Inc` folder.
134+
- Read the documentation on the wiki located in [this git repository](https://github.com/microsoft/DirectXTK.wiki.git).
135+
- Report any specific gaps in the documentation compared to the public interface.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*.VC.db
1919
*.nupkg
2020
.vs
21+
.vscode
2122
Bin
2223
packages
2324
/Src/Shaders/Compiled/*.inc

Audio/SoundCommon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ void AudioListener::SetCone(const X3DAUDIO_CONE& listenerCone)
895895
pCone = &ListenerCone;
896896
}
897897

898-
bool AudioListener::IsValid() const
898+
bool AudioListener::IsValid() const noexcept
899899
{
900900
if (!std::isfinite(OrientFront.x))
901901
return false;
@@ -943,7 +943,7 @@ void AudioEmitter::SetCone(const X3DAUDIO_CONE& emitterCone)
943943
pCone = &EmitterCone;
944944
}
945945

946-
bool AudioEmitter::IsValid() const
946+
bool AudioEmitter::IsValid() const noexcept
947947
{
948948
if (!std::isfinite(OrientFront.x))
949949
return false;

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF)
4040

4141
option(ENABLE_CODE_COVERAGE "Build with code-coverage" OFF)
4242

43+
option(ENABLE_CODE_PROFILING "Build for profiling" OFF)
44+
4345
option(USE_PREBUILT_SHADERS "Use externally built HLSL shaders" OFF)
4446

4547
option(NO_WCHAR_T "Use legacy wide-character as unsigned short" OFF)
@@ -482,6 +484,13 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
482484
endforeach()
483485
endif()
484486

487+
if(ENABLE_CODE_PROFILING)
488+
message(STATUS "Building with /PROFILE")
489+
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
490+
target_link_options(${t} PRIVATE /profile)
491+
endforeach()
492+
endif()
493+
485494
if(ENABLE_SPECTRE_MITIGATION
486495
AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.13)
487496
AND (NOT WINDOWS_STORE))

0 commit comments

Comments
 (0)