Skip to content
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

Fix Linting, Code Style, Behat, and PHP Mess Detector Errors for Green CI Pipeline #15

Open
erseco opened this issue Oct 20, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@erseco
Copy link
Collaborator

erseco commented Oct 20, 2024

Related to: #10


Problem:

Currently, our CI pipeline in GitHub Actions is failing due to several errors across different tools, including:

  • Linting errors (PHP CodeSniffer with Moodle standards)
  • Code style issues
  • Behat test failures
  • PHP Mess Detector violations

These errors are causing the pipeline to not pass consistently, making it difficult to ensure code quality and maintainability across the project.


Steps to Resolve:

  1. Fix Linting Errors:

    • Run phpcs with the Moodle coding standards across the codebase.
    • Address all identified issues related to formatting, array syntax, and missing docblocks.
  2. Code Style Fixes:

    • Run phpcbf to automatically fix any code style violations that can be resolved by the tool.
    • Manually address any remaining issues that phpcbf cannot fix.
  3. Behat Test Failures:

    • Investigate the cause of failing Behat tests.
    • Fix any logic or environment issues causing these failures.
  4. PHP Mess Detector:

    • Review and resolve any violations reported by PHP Mess Detector (PHPMD).
    • Ensure that all unused code, overly complex methods, and naming conventions are addressed.
  5. Continuous Testing:

    • After making the necessary fixes, ensure that the CI pipeline passes successfully with no errors in the following:
      • Linting (phpcs)
      • Code style (phpcbf)
      • Behat tests
      • PHP Mess Detector (phpmd)

Goal:

To have a fully green CI pipeline with all tests passing, ensuring the project meets high-quality standards and adheres to the Moodle coding guidelines.


Priority: High

@erseco erseco added the enhancement New feature or request label Oct 20, 2024
@erseco erseco self-assigned this Oct 20, 2024
@amanzano3ip
Copy link
Collaborator

Hi, I've seen that many files have already been fixed in the main branch to address this issue.

@erseco
Copy link
Collaborator Author

erseco commented Mar 30, 2025

Hi, some GitHub Actions pipelines are still failing due to remaining linting errors in various files. We can either relax the requirements to get green or apply a bigger fix to clean up the rest of the codebase automatically.

Also, I'm updating the pipeline to use the latest official workflow from https://github.com/moodlehq/moodle-plugin-ci — see the changes here: #22. This should help verify if everything is correctly configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants