Skip to content

Coding Standards, Unit tests and Playwright E2E tests. #140

Description

@mgiannopoulos24

Θα μπορούσαν να προστεθούν unit tests (phpunit ή/και playwright) ώστε να τρέχουν σε κάθε push / PR (με κάποιο workflow) για να διασφαλιστεί ότι ένα νέο feature δεν χαλάει κάποια υπάρχουσα λειτουργία.

Βέβαια το test driven development είναι λίγο αμφιλεγόμενο και επίσης δεν ξέρω αν το Mercurial υποστηρίζει workflows.

Επίσης θα μπορούσε να προστεθεί ένα phpcs.xml configuration για να τηρούνται coding standards σε όλο το codebase (κυρίως για τα .php αρχεία).

Προτεινόμενο phpcs.xml:

<?xml version="1.0"?>
<ruleset name="OpenEclass">
    <description>Coding standards for Open eClass</description>

   <file>.</file>

    <!-- Exclude files -->
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <exclude-pattern>*/node_modules/*</exclude-pattern>
    <exclude-pattern>*/storage/*</exclude-pattern>
    <exclude-pattern>*.blade.php</exclude-pattern>

    <!-- Only check PHP files. -->
	<arg name="extensions" value="php"/>

    <!-- Show progress, show the error codes for each message (source). -->
	<arg value="ps"/>

    <!-- Add colors. -->
    <arg name="colors"/>

    <!-- Base standard -->
    <rule ref="PSR12"/>

    <!-- Configs -->
	<config name="testVersion" value="7.4-" />

    <!-- Useful extras -->
    <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
    <rule ref="Generic.PHP.NoSilencedErrors"/>
    <rule ref="Squiz.PHP.NonExecutableCode"/>
    <rule ref="Squiz.Strings.DoubleQuoteUsage"/>

    <rule ref="Generic.Files.LineLength.TooLong">
        <exclude-pattern>*</exclude-pattern>
    </rule>

</ruleset>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions