Fixes the bug where nothing is first input (Closes #96)#152
Fixes the bug where nothing is first input (Closes #96)#152Davictory2003 wants to merge 6 commits intoChicoState:mainfrom
Conversation
Added a build status badge to the README.
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug where the application would display a validation message even when "nothing" was entered as the first input. The fix adds an early return when "nothing" is detected as the initial input. The PR also includes code formatting improvements for consistency and adds a GitHub Actions CI/CD workflow to automate compilation checks.
Changes:
- Added early exit logic to handle "nothing" as first input
- Reformatted code for consistency (brace placement, spacing, alphabetization)
- Added GitHub Actions workflow for automated compilation
- Added CI/CD status badge to README
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| main.cpp | Fixes the "nothing" first input bug with early return logic; applies consistent formatting throughout |
| README.md | Adds GitHub Actions CI/CD workflow status badge |
| .github/workflows/actions.yml | Introduces automated compilation workflow for CI/CD |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,44 +1,55 @@ | |||
| #include <algorithm> | |||
There was a problem hiding this comment.
Duplicate include detected. The algorithm header is included twice - once at line 1 and again at line 7. Remove one of these duplicate includes.
| install: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y -f build-essential g++ cmake | ||
| build: | ||
| needs: install | ||
| runs-on: ubuntu-latest | ||
| steps: |
There was a problem hiding this comment.
The GitHub Actions workflow has a design flaw. The 'build' job depends on 'install' job via 'needs: install', but each job runs in a fresh container. Dependencies installed in the 'install' job won't be available to the 'build' job. Either combine these into a single job or move the dependency installation steps into the 'build' job itself.
| install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y -f build-essential g++ cmake | |
| build: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y -f build-essential g++ cmake |
| install: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y -f build-essential g++ cmake | ||
| build: | ||
| needs: install | ||
| runs-on: ubuntu-latest | ||
| steps: |
There was a problem hiding this comment.
The 'build' job is missing the dependency installation step. Since each GitHub Actions job runs in a fresh container, the build tools (g++, cmake) installed in the 'install' job won't be available here. Add the installation commands to this job or remove the separate 'install' job and include those steps here.
| install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y -f build-essential g++ cmake | |
| build: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y -f build-essential g++ cmake |
No description provided.