Skip to content

Conversation

@DiFronzo
Copy link
Member

@DiFronzo DiFronzo commented May 29, 2025

Description

This PR add CI/CD to test, format, and to find spelling errors.

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore
  • ⏩ Revert

Related Tickets & Documents

Fixes #86

Tested?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ“– own file under the docs folder
  • πŸ™… no documentation needed

[optional] Are there any pre- or post-deployment tasks we need to perform?

@DiFronzo DiFronzo changed the title Create ci cd for tests and format chore: Add GitHub Actions workflows for code formatting, testing, and CodeQL analysis May 29, 2025
@DiFronzo DiFronzo marked this pull request as draft May 29, 2025 20:04
DiFronzo added 7 commits June 16, 2025 11:16
- Updated logging statements for consistency in contests.py.
- Removed unnecessary whitespace in contributions.py.
- Improved type hinting and annotations in filters.py.
- Handled specific exceptions in revision.py.
- Cleaned up unused imports and commented-out code in various files.
- Enhanced readability by adjusting formatting and spacing in web interface templates.
- Added WSGI application reference in app.py for better compatibility with servers.
@DiFronzo DiFronzo requested a review from Copilot June 16, 2025 10:18
Copy link
Contributor

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 introduces CI/CD enhancements to automate code formatting, testing, and security analysis with GitHub Actions.

  • Added new GitHub Actions workflows for running tests, performing CodeQL analysis, and checking code format and types.
  • Updated configuration files and pre-commit settings, and removed extraneous characters from several files.

Reviewed Changes

Copilot reviewed 65 out of 65 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
config/config.en.yml Removed an extraneous trailing hyphen in the YAML configuration.
README.md Removed an extraneous hyphen from the documentation.
MIT-LICENSE.txt Removed an extraneous trailing hyphen from the license file.
.pre-commit-config.yaml Added pre-commit hooks for linting, formatting, and type checking.
.github/workflows/run-tests.yml Added workflow to run tests using pytest and generate coverage.
.github/workflows/codeql-analysis.yml Added workflow to perform CodeQL security analysis.
.github/workflows/check-format-and-typing.yml Added workflow for checking code formatting and static type checking.
.description Removed an extraneous hyphen from the project description.

DiFronzo and others added 3 commits June 16, 2025 12:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jhsoby
Copy link
Member

jhsoby commented Sep 30, 2025

Does this remove newlines from the end of files? I would prefer for the coding style to have them, to stay in line with Wikimedia's coding style in general.

@DiFronzo
Copy link
Member Author

Does this remove newlines from the end of files? I would prefer for the coding style to have them, to stay in line with Wikimedia's coding style in general.

This is still a draft and needs more work before production use. The CI/CD pipeline does not modify files; it only fails if the code violates the ruleset. Currently, it fails when there is no final newline (W292). Having one newline at the end of the file is the desired state and will not cause a failure.

Potential failures at the end of a file:

  • W292: Missing final newline (last byte is not a newline)
  • W391: Blank line at end of file (extra empty line after code, e.g., two newlines)

Auto-correction using flake8/pycodestyle is possible, but right now the workflow only checks compliance. I can add this later if needed :)

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.

[FR] Add CI/CD for Testing, Formatting, and Markdown Spell Checking

3 participants