Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/lint_misc-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@ vendor/bin/licence-headers-check --ansi --no-interaction

vendor/bin/extract-locales 2>&1 | tee extract.log
if [[ -n $(grep "warning" extract.log) ]]; then exit 1; fi

echo "Check for unresolved git merge conflict markers..."
CONFLICT_MATCHES=$(grep -rn '<<<<<<<\|>>>>>>>' \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

======= should be detected too.

Suggested change
CONFLICT_MATCHES=$(grep -rn '<<<<<<<\|>>>>>>>' \
CONFLICT_MATCHES=$(grep -rn '<<<<<<<\|=======\|>>>>>>>' \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have suite of = signs in the code:

install/empty_data.php:                'content_text' => '======================================================================
install/empty_data.php:======================================================================',
tests/imap/MailCollectorTest.php:================================

Those should be changed to apply suggestion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

does this === have a special meaning in glpi_notificationtemplatetranslations table ? @stonebuzz @trasher ? or can I just remove them ? (a quick search in code tells me there is nothing special with this =)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Theoretically, the chevrons alone are enough, but if you want, I'll add this @cedric-anne

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Manual conflict resolution can result in having only the ======= line remaining, so if we want a complete detection, it is better to add it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, I agree it should be detected.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this === have a special meaning in glpi_notificationtemplatetranslations table ?

Seems like it's just a kind of "visual separator"; I guess it can be replaced.

Copy link
Copy Markdown
Member

@AdrienClairembault AdrienClairembault Apr 29, 2026

Choose a reason for hiding this comment

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

does this === have a special meaning in glpi_notificationtemplatetranslations table ? @stonebuzz @trasher ? or can I just remove them ? (a quick search in code tells me there is nothing special with this =)

It is part of the template text, isn't it? Not saying this template doesn't deserve to be changed, but it is completely unrelated to the scope of this PR.

My opinion is that the goal of this PR is to spot forgotten conflicts, which it does very well.
Spending time handling all possible cases where someone miss-edited a conflict is out of scope and probably not worth it (there are a lot more possibilities than just some "===" left over).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Almost everytime I have a conflict to handle, I do it manually. So there are the same risk to forgot a ======== line than to forgot a <<<<<<<< line.

Anyway, this can be done later.

--include='*.php' --include='*.twig' --include='*.js' --include='*.ts' --include='*.vue' \
--include='*.yml' --include='*.yaml' --include='*.css' --include='*.scss' \
ajax/ bin/ config/ css/ dependency_injection/ front/ inc/ install/ js/ public/ resources/ routes/ src/ templates/ tests/ tools/ \
| grep -v '^public/lib/' \
|| true)
if [[ -n "$CONFLICT_MATCHES" ]]; then
echo "ERROR: Unresolved git merge conflict markers found:"
echo "$CONFLICT_MATCHES"
exit 1
else
echo "✓ No unresolved git merge conflict markers found"
fi