Skip to content

Conversation

@tdulcet
Copy link
Member

@tdulcet tdulcet commented Jan 3, 2026

  • Fixed Ruff and Refurb linter errors in the Python scripts
    • Removed old Python 2 compatibility code
  • Fixed ShellCheck linter error in the Bash code in the CI
  • Updated actions/checkout in the CI

We could remove the dependency on lxml as well, as Python has built in XML parsing in the xml.etree.ElementTree module, which would improve CI performance.

Copy link
Member

@babolivier babolivier left a comment

Choose a reason for hiding this comment

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

This looks great, thanks a lot! I've noticed a (small) issue with the bash command, and I've got a few other nitpicks I'd like to see addressed before I'm happy to merge this.

tools/convert.py Outdated
failed_files[f] = e

if len(failed_files) > 0:
if failed_files:
Copy link
Member

Choose a reason for hiding this comment

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

I prefer explicitly stating the condition we're checking here (i.e. to keep this line as it is, even though it does essentially the same thing), I find it makes the code a bit easier to read.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will revert this change. See FURB115 for an explanation of the lint rule.

Copy link
Member

Choose a reason for hiding this comment

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

I think at this point it comes down to personal preference. I have a tendency to favour readability over making code as succinct as it can be, maybe sometimes to a fault - not that it's necessarily a huge deal in this case.

files=( ispdb/!(*.xml) )
if (( ${!files[*]} )); then
for file in "${files[@]}"; do
printf '::error file=%s::File name "%s" does not end in .xml – Please rename!\n' "$file" "$file"
Copy link
Member

Choose a reason for hiding this comment

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

While we're here, we could replace this printf with echo (and remove the ::error file=%s:: bit since it's a bit redundant).

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like the idea in 2921ddd was to use GitHub Actions annotations, so that it would annotate the problematic file.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, fair enough, it should probably stay then. I still think we should move away from printf to echo but I won't block on this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would have been happy to change the printf to echo. I can do so if/when I make another PR, if I remember. I see this PR as a first step towards #135/#169.

Copy link
Member

@babolivier babolivier left a comment

Choose a reason for hiding this comment

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

lgtm, thanks again!

files=( ispdb/!(*.xml) )
if (( ${!files[*]} )); then
for file in "${files[@]}"; do
printf '::error file=%s::File name "%s" does not end in .xml – Please rename!\n' "$file" "$file"
Copy link
Member

Choose a reason for hiding this comment

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

Hm, fair enough, it should probably stay then. I still think we should move away from printf to echo but I won't block on this.

@babolivier babolivier merged commit 8f774b1 into thunderbird:master Jan 15, 2026
1 check passed
@tdulcet tdulcet deleted the linting branch January 15, 2026 21:19
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.

2 participants