From 30b02c41700744fcf36776e59a68a47a57b31bc8 Mon Sep 17 00:00:00 2001 From: dolehnov Date: Sat, 15 Nov 2025 12:03:26 +0300 Subject: [PATCH 1/5] Enable multiplication functionality (CALC-3) --- .github/pull_request_template.md | 21 +++++++++++++++++++++ PR_DESCRIPTION.md | 21 +++++++++++++++++++++ index.html | 3 ++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/pull_request_template.md create mode 100644 PR_DESCRIPTION.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..86fe542 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,21 @@ +# Description + + +## Ticket + + +## Screenshot/Video (optional) + + +# Checklist + +- [ ] Linters passed +- [ ] Tests passed +- [ ] Documentation updated (if needed) + +# Review level + +- [ ] Standard review (peer review by 1-2 developers) +- [ ] Techlead/Architect review required +- [ ] QA review required + diff --git a/PR_DESCRIPTION.md b/PR_DESCRIPTION.md new file mode 100644 index 0000000..07a3f4d --- /dev/null +++ b/PR_DESCRIPTION.md @@ -0,0 +1,21 @@ +# Description +Enable multiplication functionality in the calculator application. The multiply button (*) was previously disabled and the multiplication operation was not implemented in the calculation logic. This PR removes the disabled state from the multiply button and adds the multiplication case to the switch statement. + +## Ticket +CALC-3 + +## Screenshot/Video (optional) + + +# Checklist + +- [x] Linters passed +- [ ] Tests passed +- [ ] Documentation updated (if needed) + +# Review level + +- [x] Standard review (peer review by 1-2 developers) +- [ ] Techlead/Architect review required +- [ ] QA review required + diff --git a/index.html b/index.html index 8bfd362..cf40e23 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@
0
- + @@ -74,6 +74,7 @@ switch (operator) { case '+': result = firstOperand + secondOperand; break; case '-': result = firstOperand - secondOperand; break; + case '*': result = firstOperand * secondOperand; break; } currentInput = result.toString(); operator = null; From e0c860387177e09276880181b0d0a2c6bd97eb8a Mon Sep 17 00:00:00 2001 From: dolehnov Date: Sat, 15 Nov 2025 12:18:42 +0300 Subject: [PATCH 2/5] chore: improve repository structure - add .gitignore and README --- .gitignore | 42 ++++++++++++++++++++++++++++++++++++++++++ PR_DESCRIPTION.md | 21 --------------------- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 21 deletions(-) create mode 100644 .gitignore delete mode 100644 PR_DESCRIPTION.md create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..066c77e --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# OS-specific files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db +desktop.ini + +# Editor directories and files +.vscode/ +.idea/ +*.swp +*.swo +*~ +.project +.classpath +.settings/ + +# Temporary files +*.tmp +*.temp +*.log +PR_DESCRIPTION.md + +# Node modules (if you add npm packages later) +node_modules/ +package-lock.json +yarn.lock + +# Build outputs +dist/ +build/ +*.min.js +*.min.css + +# Environment files +.env +.env.local +.env.*.local + diff --git a/PR_DESCRIPTION.md b/PR_DESCRIPTION.md deleted file mode 100644 index 07a3f4d..0000000 --- a/PR_DESCRIPTION.md +++ /dev/null @@ -1,21 +0,0 @@ -# Description -Enable multiplication functionality in the calculator application. The multiply button (*) was previously disabled and the multiplication operation was not implemented in the calculation logic. This PR removes the disabled state from the multiply button and adds the multiplication case to the switch statement. - -## Ticket -CALC-3 - -## Screenshot/Video (optional) - - -# Checklist - -- [x] Linters passed -- [ ] Tests passed -- [ ] Documentation updated (if needed) - -# Review level - -- [x] Standard review (peer review by 1-2 developers) -- [ ] Techlead/Architect review required -- [ ] QA review required - diff --git a/README.md b/README.md new file mode 100644 index 0000000..53c747b --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# Calculator Application + +A simple, modern calculator web application built with vanilla HTML, CSS, and JavaScript. + +## Features + +- Basic arithmetic operations (addition, subtraction, multiplication) +- Clean and intuitive user interface +- Responsive design +- Real-time calculation display + +## Getting Started + +Simply open `index.html` in your web browser. No build process or dependencies required. + +## Usage + +1. Click number buttons to enter digits +2. Click an operator button (+, -, *) to select an operation +3. Enter the second number +4. Click the equals (=) button to calculate the result +5. Click Clear (C) to reset the calculator + +## Project Structure + +``` +tl_tech_task/ +├── index.html # Main calculator application +├── README.md # Project documentation +└── .github/ # GitHub templates and workflows + └── pull_request_template.md +``` + +## Development + +This is a single-file application. All HTML, CSS, and JavaScript are contained in `index.html`. + +## License + +[Add your license here] + From 509da87ecef945f835200cf483c3ad513e92b6ac Mon Sep 17 00:00:00 2001 From: dolehnov Date: Sat, 15 Nov 2025 12:35:40 +0300 Subject: [PATCH 3/5] ci: add GitHub Actions workflow for HTML and JavaScript validation --- .github/workflows/ci.yml | 110 +++++++++++++++++++++++++++++++++++++++ .htmlvalidate.json | 9 ++++ 2 files changed, 119 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .htmlvalidate.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fa00a27 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,110 @@ +name: CI + +on: + push: + branches: [ main, 'CALC-*' ] + pull_request: + branches: [ main ] + +jobs: + validate: + name: Validate HTML and Code Quality + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Validate HTML file exists + run: | + if [ ! -f index.html ]; then + echo "❌ Error: index.html not found" + exit 1 + fi + echo "✅ index.html exists" + + - name: Check HTML structure + run: | + # Check for required HTML elements + if ! grep -q "" index.html; then + echo "❌ Missing DOCTYPE declaration" + exit 1 + fi + if ! grep -q " tag" + exit 1 + fi + if ! grep -q " tag" + exit 1 + fi + if ! grep -q " tag" + exit 1 + fi + echo "✅ Basic HTML structure is valid" + + - name: Validate JavaScript syntax + run: | + # Extract JavaScript content + awk '/