Skip to content

Modularize index template and add project setup#32

Merged
rtuszik merged 14 commits intomainfrom
develop
Nov 2, 2025
Merged

Modularize index template and add project setup#32
rtuszik merged 14 commits intomainfrom
develop

Conversation

@rtuszik
Copy link
Owner

@rtuszik rtuszik commented Jul 18, 2025

  • Reorganize index templates into modular components
  • Move from monolithic index_template.html to component-based structure
  • Extract CSS into separate file for better maintainability
  • Split JavaScript into dedicated main.js file
  • Create reusable body, footer, and header components
  • Update base template with consistent favicon and font loading
  • add pyproject.toml and .python-version for project setup and dependency management

@sourcery-ai sourcery-ai bot changed the title @sourcery-ai title Modularize index template and add project setup Jul 18, 2025
sourcery-ai[bot]

This comment was marked as outdated.

@socket-security
Copy link

socket-security bot commented Jul 18, 2025

@sonarqubecloud

This comment was marked as spam.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the project's dependency management and tooling by migrating from requirements.txt to uv with a pyproject.toml configuration. Key changes include:

  • Migration from pip to uv for dependency management with lock file
  • Addition of dev dependencies (ruff, bandit, ty, vulture) for code quality
  • Addition of DVORAK keyboard layout support
  • Code formatting standardization (moving imports, applying consistent quote styles)
  • Template restructuring: splitting monolithic HTML into modular components
  • Schema addition for YAML validation
  • GitHub Actions workflow updates to use uv and new linting tools

Reviewed Changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pyproject.toml New project configuration with dependencies and ruff settings
uv.lock Locked dependency versions for reproducible builds
yaml_cheatsheet_spec.md Added DVORAK to valid keyboard layouts
src/validate_yaml.py Code formatting (quotes, imports, spacing)
src/generate_cheatsheet.py Code formatting and refactored index generation
src/templates/index/* Split monolithic template into modular components
src/templates/base.html Fixed invalid HTML attribute, added common head elements
docs/schema/cheatsheet.schema.json New JSON Schema for YAML validation
.github/workflows/lint.yml Replaced super-linter with dedicated uv-based checks
README.md Updated installation instructions for uv

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python-version-file should reference .python-version (which contains '3.13'), not pyproject.toml. The pyproject.toml specifies requires-python = \">=3.9\" which is a constraint, not a specific version to use for the action.

Copilot uses AI. Check for mistakes.
<option value="name-desc">Name (Z-A)</option>
</select>
<select id="items-per-page" class="items-per-page-select">
<option value="9" selected>9 per page</option>
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value of '9' in the HTML doesn't match the JavaScript default of itemsPerPage = 9 at line 45 of main.js, but there's a discrepancy - the original template had '8 per page' as the first option but the JS used 9. This change makes the HTML match the JS, but the option value should probably be '8' to match the previous behavior, or update the JS to use 9 explicitly.

Suggested change
<option value="9" selected>9 per page</option>
<option value="8" selected>8 per page</option>
<option value="9">9 per page</option>

Copilot uses AI. Check for mistakes.
Comment on lines 15 to 18
- package-ecosystem: "uv"
target-branch: "dev"

directory: "/"
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent blank line placement: there's a blank line between target-branch: \"dev\" and directory: \"/\" but not for the other package ecosystems. Remove the blank line on line 17 for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +20
<script>
{% include "index/scripts/main.js" %}
</script>
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: Unexpected token

Suggested change
<script>
{% include "index/scripts/main.js" %}
</script>
<script src="{{ url_for('static', filename='index/scripts/main.js') }}"></script>

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +43
const cheatsheets = [
{% for cheatsheet in cheatsheets %}
{ title: {{ cheatsheet.title|tojson }}, filename: {{ cheatsheet.filename|tojson }} },
{% endfor %}
];

Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: Unexpected token

Suggested change
const cheatsheets = [
{% for cheatsheet in cheatsheets %}
{ title: {{ cheatsheet.title|tojson }}, filename: {{ cheatsheet.filename|tojson }} },
{% endfor %}
];
// Replace the following with actual cheatsheet data.
// Example: If you have a global variable `window.cheatsheetsData` defined in your HTML:
const cheatsheets = window.cheatsheetsData || [];
// If you need to embed the data, define it in your HTML as:
// <script>
// window.cheatsheetsData = [
// { title: "Cheat 1", filename: "cheat1.html" },
// { title: "Cheat 2", filename: "cheat2.html" }
// ];
// </script>

Copilot uses AI. Check for mistakes.
@rtuszik rtuszik merged commit e91c2f9 into main Nov 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants