Skip to content

ONEKEY baseline#23

Open
qkaiser wants to merge 13 commits intomasterfrom
onekey-baseline
Open

ONEKEY baseline#23
qkaiser wants to merge 13 commits intomasterfrom
onekey-baseline

Conversation

@qkaiser
Copy link
Collaborator

@qkaiser qkaiser commented Mar 13, 2026

This establish our baseline by implementing the following:

  • pre-commit checks:
    • JSON, TOML, YAML validation
    • check for large files being committed outside git LFS
    • ruff check, ruff format
    • toml linting and formatting with taplo
    • vulture to check for dead code
    • renovat config checker
  • moved from setuptools to uv with pyproject.toml definition
  • move to pytest for tests execution
  • moved integration tests to dedicated directory, track test files with git LFS
  • use pyright for type checking
  • add issue templates for bug report and feature suggestion
  • add CI action and workflow to run tests on python version from 3.10 to 3.14 + type checking + pre-commit run
  • updated the copyright mention in the license
  • got rid of unneeded/old files

The code logic was not modified. All code modifications were made by ruff or inserted to address issues reported by pyright.

@qkaiser qkaiser self-assigned this Mar 13, 2026
@qkaiser qkaiser force-pushed the onekey-baseline branch 2 times, most recently from 869d3fe to 01e0b25 Compare March 13, 2026 08:58
Add CI action to pull git lFS file. Add CI worfklow to run pre-commit,
tests, and type checking + codeQL analysis.
@kissgyorgy
Copy link

Can you split this up by topic please? It would be much easier and faster to review and merge them one by one.

Copy link

@e3krisztian e3krisztian left a comment

Choose a reason for hiding this comment

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

Looks good overall!

]

ignore = [
"A005", # stdlib-module-shadowing: E.g. `unblog.logging` collides with stdlib `logging`. It's okay for us

Choose a reason for hiding this comment

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

I'd drop this line, or fix the bogus comment.

Choose a reason for hiding this comment

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

These files are small. Why complicate with git lfs?

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:af2667929275f3c34f731d066c3756ac97943e31fa753532eddd32e3da83c2c3
size 214

Choose a reason for hiding this comment

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

This is a git-lfs file, but LFS is not configured, yet (and maybe we should not at all?).

#1/84 1364081511 1000 100 100644 84 `
a_very_long_name_for_the_gnu_type_header_so_it_can_overflow_the_standard_name_length#1/96 1364081511 1000 100 100644 96 `
a_very_long_name_for_the_gnu_type_header_so_it_can_overflow_the_standard_name_length_with_space No newline at end of file
a_very_long_name_for_the_gnu_type_header_so_it_can_overflow_the_standard_name_length_with_space

Choose a reason for hiding this comment

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

This end of line change looks wrong.

@@ -4,4 +4,3 @@ test_in_file_1

file2/ 1364071325 1000 100 100644 15 `
test_in_file_2

Choose a reason for hiding this comment

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

This end of line change looks wrong.

the data contained in the archive. Archived files are accessible via file-like
objects.

"""arpy module can be used for reading `ar` files' headers, as well as accessing the data contained in the archive. Archived files are accessible via file-like objects.

Choose a reason for hiding this comment

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

This become a very long line.

Comment on lines +326 to +329
if self.gnu_table[position].endswith(b"/"):
self.gnu_table[position] = self.gnu_table[position][
:-1
] # remove trailing '/'

Choose a reason for hiding this comment

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

Since Python 3.9 (https://peps.python.org/pep-0616/) there is bytes.removesuffix.

self.gnu_table[position] = filename.removesuffix(b"/")

Original trigger was: I hate when lines are split like this due to "line length"

Comment on lines +479 to +480
for _key in ar.archived_files:
pass

Choose a reason for hiding this comment

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

?

Choose a reason for hiding this comment

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

The original code printed something at this place.

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.

3 participants