Skip to content

Apply PHPCS auto-fixes across JS and tooling#86

Open
jsirish wants to merge 2 commits into2from
bugfix/phpcs-autofix
Open

Apply PHPCS auto-fixes across JS and tooling#86
jsirish wants to merge 2 commits into2from
bugfix/phpcs-autofix

Conversation

@jsirish
Copy link
Member

@jsirish jsirish commented Sep 27, 2025

Summary

  • run phpcbf with the module's coding standard to reformat JavaScript sources and helper tooling
  • add required visibility modifiers to CalendarSubscriptionTest constants flagged by PHPCS
  • ensure webpack and utility scripts align with the declared code style

Testing

  • ddev exec ./run-calendar-tests.sh

Copilot AI review requested due to automatic review settings September 27, 2025 16:58
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 applies PHPCS (PHP CodeSniffer) auto-fixes to JavaScript files and PHP tooling to enforce consistent code formatting across the module. The changes standardize brace placement, add required visibility modifiers, and ensure proper code style compliance.

Key changes:

  • JavaScript functions now use opening braces on new lines consistent with the module's coding standard
  • PHP constants in test class now have required public visibility modifiers
  • Added proper guard clauses with braces for improved readability

Reviewed Changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.

File Description
tools/validate_ics.php Updated function brace placement to match coding standards
tests/Controller/CalendarSubscriptionTest.php Added required public visibility modifiers to class constants
client/src/js/components/*.js Standardized JavaScript function brace placement and added braces to single-line conditionals
client/src/js/calendar.js Applied consistent brace formatting to class methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

The CSS class name contains spaces around the hyphens which will create invalid class names. Should be swipe-indicator swipe-${direction}.

Suggested change
indicator.className = `swipe - indicator swipe - ${direction}`;
indicator.className = `swipe-indicator swipe-${direction}`;

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

The URL construction is incorrect - there's a space before the question mark. Should be ${baseUrl}events?${params.toString()}.

Suggested change
return `${baseUrl}events ? ${params.toString()}`;
return `${baseUrl}events?${params.toString()}`;

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

The HTML template has spaces around operators that will result in invalid HTML attributes. The spaces around <, =, and - should be removed.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

The HTML template has spaces around the < operator and = signs that will result in invalid HTML. Should be <div class=\"alert alert-warning\">.

Copilot uses AI. Check for mistakes.
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.

1 participant

Comments