-
Notifications
You must be signed in to change notification settings - Fork 9
Improve .gitignore and starter code for C++ #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ates; include necessary entries for various OS and IDEs. Update main.cpp files to include <string> header for string operations.
WalkthroughThe updates primarily add the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Program
User->>Program: Start program
Program->>User: (Optional) Output prompt "$ "
User->>Program: Enter input (read as std::string)
Program->>User: (Optional) Output error "<input>: command not found"
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
solutions/cpp/02-cz2/code/src/main.cpp (1)
13-13
: Use stderr for error messages
Error messages are conventionally sent tostd::cerr
rather thanstd::cout
. Consider replacing:std::cout << input << ": command not found" << std::endl;
with:
std::cerr << input << ": command not found" << std::endl;
starter_templates/cpp/code/.gitignore (1)
951-953
: Consider adding root-level build/ directory
Many C++ projects generate a root-levelbuild/
directory (e.g., out-of-source builds). You may want to include:build/
to ignore this common directory.
compiled_starters/cpp/.gitignore (1)
951-953
: Suggest ignoring root-level build/ directory
To accommodate out-of-source builds, consider adding:build/
at the top level.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
compiled_starters/cpp/.gitignore
(2 hunks)compiled_starters/cpp/src/main.cpp
(1 hunks)solutions/cpp/01-oo8/code/.gitignore
(2 hunks)solutions/cpp/01-oo8/code/src/main.cpp
(1 hunks)solutions/cpp/01-oo8/diff/src/main.cpp.diff
(1 hunks)solutions/cpp/02-cz2/code/src/main.cpp
(1 hunks)solutions/cpp/02-cz2/diff/src/main.cpp.diff
(1 hunks)starter_templates/cpp/code/.gitignore
(2 hunks)starter_templates/cpp/code/src/main.cpp
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: test_course_definition / test (zig)
- GitHub Check: test_course_definition / test (go)
- GitHub Check: test_course_definition / test (c)
- GitHub Check: test_course_definition / test (kotlin)
- GitHub Check: test_course_definition / test (cpp)
- GitHub Check: test_course_definition / test (java)
- GitHub Check: test_course_definition / test (csharp)
🔇 Additional comments (11)
solutions/cpp/02-cz2/code/src/main.cpp (1)
2-2
: Add missing header
The new usage ofstd::string
andstd::getline
requires including the<string>
header to ensure proper compilation.solutions/cpp/01-oo8/code/src/main.cpp (1)
2-2
: Include for std::string usage
Adding<string>
ensures thatstd::string
and related functions are available.starter_templates/cpp/code/src/main.cpp (1)
2-2
: Add header
The template now usesstd::string
andstd::getline
, so<string>
is required for compilation.starter_templates/cpp/code/.gitignore (1)
1-1047
: Replace minimal .gitignore with comprehensive C++ patterns
This new.gitignore
covers multi-platform OS artifacts, IDE files, build systems (Gradle, CMake), version control metadata, and language-specific binaries for C and C++. The consistency with other C++ templates improves repository hygiene.compiled_starters/cpp/.gitignore (1)
1-1047
: Comprehensive .gitignore overhaul for C++
This.gitignore
now uniformly handles OS caches, IDE configs, Gradle/CMake artifacts, version control dirs, and C/C++ compiled outputs. The detailed patterns align with best practices for cross-platform C++ development.compiled_starters/cpp/src/main.cpp (1)
2-2
: Good addition of the string header.Adding
#include <string>
is necessary since the code usesstd::string
for theinput
variable. This follows good C++ practice by explicitly including headers for the types being used.solutions/cpp/01-oo8/diff/src/main.cpp.diff (2)
3-3
: Good addition of the string header.Adding
#include <string>
is necessary since the code usesstd::string
for theinput
variable. This follows good C++ practice by explicitly including headers for the types being used.
10-12
: Properly enabling the prompt.Uncommenting the prompt line as instructed by the comment "Uncomment this block to pass the first stage". This fulfills the intention expressed in the original code comment.
solutions/cpp/02-cz2/diff/src/main.cpp.diff (2)
3-3
: Good addition of the string header.Adding
#include <string>
is necessary since the code usesstd::string
for theinput
variable. This follows good C++ practice by explicitly including headers for the types being used.
14-14
: Good implementation of the error message.This line correctly outputs an error message when an unrecognized command is entered, improving user feedback.
solutions/cpp/01-oo8/code/.gitignore (1)
1-1047
: Excellent comprehensive .gitignore update.The extensive update to the
.gitignore
file provides comprehensive coverage for multiple platforms, IDEs, build systems, and languages. This is a significant improvement that will help keep the repository clean regardless of the development environment being used.The new file properly covers:
- OS-specific files (Windows, Linux, macOS, Android)
- IDE/editor files (Visual Studio, JetBrains, Eclipse, VS Code, etc.)
- Build artifacts for C and C++ projects
- Various build systems (CMake, Gradle)
This standardization will prevent unnecessary files from being committed to the repository.
Thanks @wuxianggujun for highlighting the issue! |
Summary by CodeRabbit
New Features
$
) before accepting input.<input>: command not found
.Bug Fixes
Chores
.gitignore
files to better exclude generated, temporary, and environment-specific files across multiple platforms and tools.