* Qual: Add pre-commit hooks for Perl code formatting and linting
- Added perltidy hook to format Perl code
- Added perlcritic hook to lint Perl code
* Qual: Update file opening syntax in build scripts (perltidy)
The changes update the syntax for opening files in several build scripts to use the three-argument form of the `open` function, which is more secure and recommended in modern Perl practices.
* Qual: Improve file handling and add strict/warnings pragmas (perlcritic)
The changes include:
- Adding 'use strict' and 'use warnings' pragmas to enforce better coding practices
- Improving file handling by using lexical filehandles (my $IN, my $SPECFROM, etc.)
- Fixing file opening and closing operations to use proper error handling
- Updating various file operations to use the new lexical filehandles
- Fixing indentation and formatting issues in the code
* Qual: Add strict and warnings pragmas to Perl scripts (perlcritic)
The changes add 'use strict;' and 'use warnings;' pragmas
- dev/build/doxygen/dolibarr-doxygen-build.pl
- dev/build/doxygen/dolibarr-doxygen-filter.pl
- dev/build/doxygen/dolibarr-doxygen-getversion.pl
- dev/build/gource/getavatars.pl
- dev/tools/dolibarr-mysql2pgsql.pl
* Qual: Add Perl no critic pragmas (perlcritic)
- Ignore some perlcritic notices
* Qual: Improve code formatting and readability
Perltidy:
- Indentation and spacing
- Improved variable naming and alignment
- Better code organization and structure
- Enhanced readability of conditional statements and loops
These changes do not alter the functionality of the script but make it more maintainable and easier to understand.
* qual: Exclude virtualmin from perltidy and perlcritic hooks
Exclude the virtualmin directory from both perltidy and perlcritic hooks due to specific reasons mentioned in the comment. This change ensures that these hooks do not process files in the virtualmin directory.
* Qual: Add installation of perltidy and perlcritic for pre-commit workflow
This commit adds the installation of perltidy and perlcritic as part of the pre-commit hooks workflow.
* Fix: Update version detection in dolibarr-doxygen-build.pl
- Add support for detecting version from DOL_MAJOR_VERSION and DOL_MINOR_VERSION constants
- Fix undefined variable issue in version detection
* Fix: Update getavatars.pl to use HTTPS and reverse git log
- Changed the URL from HTTP to HTTPS for Gravatar
- Added `--reverse` flag to git log command to process commits in chronological order (faster)
- Updated error message to indicate .git repository instead of .git directory (+ correct test)
* fix: Correct spelling in error messages and prompts
- Fixed typo in error message for missing environment variables
- Corrected spelling in prompt for module name input
- Improved clarity in comment for target checking
* Qual: Update pre-commit hooks
# Qual: Update pre-commit hook
Updated several pre-commit hooks as long as the new ones are not alpha or beta versions
* Qual: Fix/ignore some shellcheck issues
* Update tool versions in .pre-commit-config
# Update tool versions in .pre-commit-config
Update tool versions for pre-commit.
codespell is updated in #33493 .
Prettier was upgraded to 3.1.0 - higher versions are
not compatible with the normal pre-commit workflow apparently.
* Ignore notice from sqlfluff
Ignore LT14 - The 'WHERE' keyword should always start a new line.
* new: add duration extrafields
* style: fix style
* ci: fix precommit config
* style: run cs fixer
* ci: adapt type to fit with php-stan
* ci: adapt type to fit with php-stan
* ci: adapt type to fit with php-stan
---------
Co-authored-by: Benoît PASCAL <contact@p-ben.com>
* Qual: More specific ignoreErrors for phpstan
# Qual: More specific ignoreErrors for phpstan
More specific ignore expressions helps identify new exceptions that
would have matched the more generic ignore expressions.
It also helps to progressively solve phpstan notices
in smaller steps by modifying the expressions
* CamelCase for dictFieldList
* Update phan baseline
* QUAL: Add sqlfluff (SQL code and style check)
# QUAL: Add sqlfluff (SQL code and style check)
This adds a validity and style check on the .sql files.
The same tool can be used to fix style (which can be set up as a
pre-commit hook).
* Ignore some sqlfluff notices
* Ignore RF04 notice, warning about the use of sql keywords
* Adjust dialects for some directories
# NEW: Script for fast identification of missing/unused/duplicate translations
Fast analysis of files to identify missing, unused and duplicate translations.
Fast = less than 3 seconds when there are no exceptions (on my development machine).
# Qual: Review pre-commit configure - re-enable no-commit-to-branch
This reviews some of the documentation inside the pre-commit-config.yaml file.
It also re-enables the no-commit-to-branch hook.
Also enable spelling on hidden files (changes to pyproject.toml +
exceptions file).
* Fix: PhanParamSignatureMismatch
# Fix: PhanParamSignatureMismatch
PhanDoc was updated to require specific types which changes the method signature
versus the parent.
This results in a signature mismatch.
Updated to maintain the method signature but dynamically check that
the object type is correct.
* Update pre-commit for php-cs
* Qual: Lower severity on php-cs messages that should not block (#28072)
# Qual: Lower severity on php-cs messages that should not block
Some warning messages result in php-cs having an exit code of 2 and others
only have an exit ocde of 1. When the exit code is 2, the warnings are fixable
by php-cbf.
In order to be able to filter on the warnings in the github ci flow, but still
show them in the travis flow, I lower the level of the warnings that should not
be blocking to 4.
At the same time, the php-cs configuration in pre-commit now requires that the
severity is minimum 5 to show the message (level 5 is the default for all warnings
and errors).
So this will limit the warning messages to the ones that should result in a failing
ci action. If any new cases are discovered, they should also be lowered in the
php-cs configuration file.
* Qual: ci: Run pre-commit/php-cs with cache (#28079)
This adds a hook to .pre-commit-config.yaml and updates the workflow
to run php-cs with cache when it is run for all files.
When running on changed files only, the cache is not useful.
The php-codesniffer ruleset.xml was cleaned up (duplicates removal/formatted)
* Qual: Fix/extend language scripts, integrate in pre-commit
Updated scripts to comply with shellscript.
Integrated one in pre-commit that seems useful.
* Qual: Find duplicate lang keys
* Add line numbers (to allow annotation)
* Fix fixaltlanguages.sh and add to pre-commit
* Make historical language checks 'manual' in 'pre-commit'
This adds a hook to .pre-commit-config.yaml and updates the workflow
to run php-cs with cache when it is run for all files.
When running on changed files only, the cache is not useful.
The php-codesniffer ruleset.xml was cleaned up (duplicates removal/formatted)