Skip to content

Commit

Permalink
Correct baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Aug 13, 2024
1 parent fbfef0b commit 1bbccce
Show file tree
Hide file tree
Showing 10 changed files with 1,390 additions and 1,352 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ jobs:


# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one failes, the following action may help
# To cancel jobs if one fails, the following action may help
# - if: "failure()"
# uses: "andymckay/[email protected]"
27 changes: 23 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
exclude: (?x)^( htdocs/includes/ckeditor/.* )
exclude: (?x)^( htdocs/includes/ckeditor/.*|(\.[^/]*/.*))$
repos:
# Several miscellaneous checks and fix (on yaml files, end of files fix)
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -11,7 +11,12 @@ repos:
args: [--unsafe]
- id: check-json
- id: mixed-line-ending
exclude: (?x)^(htdocs/includes/tecnickcom/tcpdf/fonts/.*)$
# alternative for dev/tools/fixdosfiles.sh
exclude: |
(?x)^(htdocs/includes/tecnickcom/tcpdf/fonts/.*
|.*/CRLF.*.php # Files in swiftmailer
)$
args: [--fix=lf]
- id: trailing-whitespace
exclude_types: [markdown]
- id: end-of-file-fixer
Expand All @@ -31,7 +36,8 @@ repos:
rev: v6.2.1
hooks:
- id: beautysh
exclude: (?x)^(dev/setup/git/hooks/pre-commit)$
exclude:
(?x)^(dev/setup/git/hooks/pre-commit)$
args: [--tab]

# Run local script
Expand Down Expand Up @@ -66,6 +72,7 @@ repos:
--standard=dev/setup/codesniffer/ruleset.xml,
--report=emacs,
--severity=5,
--no-colors,
]
- alias: php-cs-with-cache
id: php-cs
Expand All @@ -76,6 +83,7 @@ repos:
--standard=dev/setup/codesniffer/ruleset.xml,
--report=emacs,
--severity=5,
--no-colors,
--cache=.cache/pre-commit/dolibarr-php-cs.cache,
.,
]
Expand Down Expand Up @@ -162,7 +170,18 @@ repos:
- dev/tools/codespell/codespell-lines-ignore.txt
- --uri-ignore-words-list
- ned

- alias: codespell-ignores
#
# Update codespell ignore file.
#
# Execute with `pre-commit run codespell -a --hook-stage manual`
id: codespell
stages: [manual]
name: Update file with codespell exceptions
additional_dependencies: [tomli]
language: python
entry: bash -c '[ ! -x dev/tools/codespell/addCodespellIgnores.sh ] || dev/tools/codespell/addCodespellIgnores.sh'
pass_filenames: false
# Check some shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
Expand Down
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
- stage: PHP 7.0-8.1
if: type = push
php: '7.1'
env:
env:
- DB=postgresql
- TRAVIS_PHP_VERSION=7.1
- stage: PHP 7.0-8.1
if: type = pull_request OR type = push
php: '8.1'
env:
env:
- DB=mysql
- TRAVIS_PHP_VERSION=8.1
#- stage: PHP Dev
Expand Down Expand Up @@ -108,12 +108,12 @@ install:
- |
if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
sudo update-alternatives --set php /usr/bin/php7.1
fi
fi
if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then
sudo update-alternatives --set php /usr/bin/php8.1
fi
fi
php -i | head -
- |
echo "Updating Composer config"
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
Expand Down Expand Up @@ -216,7 +216,7 @@ before_script:
#sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa
sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa &
sleep 3
sudo ps fauxww
sudo ps fauxww
echo "MySQL set root password"
sudo mysql -u root -h 127.0.0.1 -e "FLUSH PRIVILEGES; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8'; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'password'; CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON travis.* TO [email protected]; GRANT ALL PRIVILEGES ON travis.* TO [email protected]; FLUSH PRIVILEGES;"
echo "MySQL grant"
Expand All @@ -225,15 +225,15 @@ before_script:
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'use mysql; select * from user;'
echo "List pid file"
sudo mysql -u root -h 127.0.0.1 -ppassword -e "show variables like '%pid%';"
#sudo kill `cat /var/lib/mysqld/mysqld.pid`
#sudo systemctl start mariadb
echo "MySQL grant"
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO [email protected];'
echo "MySQL flush"
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'FLUSH PRIVILEGES;'
echo "MySQL load sql"
sudo mysql -u root -h 127.0.0.1 -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
Expand Down Expand Up @@ -371,12 +371,12 @@ script:
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE
#cat $INSTALL_FORCED_FILE
- |
echo "Upgrading Dolibarr"
# Ensure we catch errors with -e. Set this to +e if you want to go to the end to see log files.
# Note: We keep +e because with pgsql, one of upgrade process fails even if migration seems ok, so
# I disable stop on error to be able to continue.
# I disable stop on error to be able to continue.
set +e
cd htdocs/install
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
Expand Down Expand Up @@ -444,7 +444,7 @@ script:
- |
echo Result of migration scripts
ls -alrt $TRAVIS_BUILD_DIR/
echo Show content of last file
cat $TRAVIS_BUILD_DIR/"$(ls -rt $TRAVIS_BUILD_DIR/ | tail -n1)"
Expand Down Expand Up @@ -494,18 +494,18 @@ after_failure:
# Show upgrade log files
#for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
#do
#echo "Debugging informations for file $ficlog"
#echo "Debugging information for file $ficlog"
#cat $ficlog
#done
# Show Apache log file
echo "Debugging informations for file apache error.log"
echo "Debugging information for file apache error.log"
sudo tail -n 200 /var/log/apache2/travis_error_log
if [ "$DEBUG" = true ]; then
# Dolibarr log file
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
echo "Debugging information for file dolibarr.log (latest 50 lines)"
tail -n 200 $TRAVIS_BUILD_DIR/documents/dolibarr.log
# Database log file
echo "Debugging informations for file mysql error.log"
echo "Debugging information for file mysql error.log"
sudo tail -n 200 /var/log/mysql/error.log
# TODO: PostgreSQL log file
echo
Expand Down
1 change: 1 addition & 0 deletions dev/setup/codesniffer/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<!-- info: 'relative' paths are relative to the examined file, so not ok. -->
<exclude-pattern>/build/(html|aps)/</exclude-pattern>
<exclude-pattern>/dev/tools/test/namespacemig/</exclude-pattern>
<exclude-pattern>/dev/tools/phan/stubs/</exclude-pattern>
<!-- <exclude-pattern>dev/initdata/dbf/includes</exclude-pattern> -->
<exclude-pattern>/documents/</exclude-pattern>
<exclude-pattern>/htdocs/core/class/lessc\.class\.php</exclude-pattern>
Expand Down
8 changes: 8 additions & 0 deletions dev/tools/codespell/codespell-dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ aploha->alpha
aplohanothtml->alphanohtml
aplphanothtml->alphanohtml
choosed->chosen
cumuled->cumulative
dokument->document
dolibar->dolibarr
dolibarrr->dolibarr
dollibar->dolibarr
dollibarr->dolibarr
extrafeild->extrafield
thoose->those
# fiche->card
nempty->an empty, empty, not empty,
mot de passe->password
not de passe->password
nothtml->nohtml
shippin->shipping
tableau de bord->state board
tagret->target
thridparty->thirdparty
wysiwig->wysiwyg
62 changes: 28 additions & 34 deletions dev/tools/codespell/codespell-ignore.txt
Original file line number Diff line number Diff line change
@@ -1,81 +1,73 @@
# List of words codespell will ignore
# one per line, case-sensitive (when not lowercase)

# PROVid
provid

# PostgreSQL
postgresql

alltime
# Name of contributores
noe
udo
tim

# Inside email
ba
blacklist
whitelist
bu
captial
categorie
categories
crypted
clos
crypted
contaxt
courant
datea
datee
doubleclick
errorstring
exten
falsy
master
medias
noe
NOO
noo
od
nd
udate
periode
projet
referer
referers
scrit
ser
ro
slave
savvy
# Inside email
suport
te
technic
thead
udo
ue
ro
whitelist
ws

# Thirdparty should be Third party or Third-party but ignoring it because it's omnipresent
thirdparty

# Code string
ect
tempdate
# checkES
checkes
sav
files'
# Used as array ke

# Used as array key
seeked
# Used as translation key
developpers
# Used as var
pice
tweek

# Used as key
marge
# htdocs/projet/activity/permonth.php
tweek

# moral (var name)
mor
# reyear, remonth, reday
reday

# Strings used as keys for translation
uptodate
reenable

# Function - rename to devalidate ?
unvalidate

# Some french strings
somme
caracteres
cas
sur
Datas
Expand All @@ -87,5 +79,7 @@ dur
fonction
espace
methode
# Proper names
tim
datee

# other
blacklists
Loading

0 comments on commit 1bbccce

Please sign in to comment.