Skip to content

Commit

Permalink
Run all commit hooks and fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed Feb 7, 2024
1 parent 9475c19 commit 2c0bbf0
Show file tree
Hide file tree
Showing 49 changed files with 300 additions and 438 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/device-support-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ body:
- type: textarea
attributes:
label: Additional context
description: Please provide any additional context or information that might be helpful in adding support for this device.
description: Please provide any additional context or information that might be helpful in adding support for this device.
render: Markdown
6 changes: 3 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- run: black .
- run: ruff openandroidinstaller/ --ignore E501
- run: PYTHONPATH=openandroidinstaller:$(PYTHONPATH) pytest --cov=openandroidinstaller tests/

build:
needs: ci
runs-on: ${{ matrix.os }}
Expand All @@ -43,7 +43,7 @@ jobs:
with:
name: openandroidinstaller-${{ github.ref_name }}-${{ matrix.os }}
path: dist/

build-windows:
needs: ci
runs-on: 'windows-latest'
Expand All @@ -59,7 +59,7 @@ jobs:
with:
name: openandroidinstaller-${{ github.ref_name }}-windows-latest
path: dist/

create-release:
needs:
- build
Expand Down
122 changes: 61 additions & 61 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ __pycache__
*.py[cod]
*$py.class

# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec
# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec
heimdall/
libusb-windows/
openandroidinstaller/bin/
Expand All @@ -33,17 +33,17 @@ pip-log.txt
pip-delete-this-directory.txt
*.log

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
Expand Down Expand Up @@ -72,42 +72,42 @@ env/
venv/
ENV/

# If you are using PyCharm #
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/gradle.xml
.idea/**/libraries
*.iws /out/
# If you are using PyCharm #
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/gradle.xml
.idea/**/libraries
*.iws /out/

# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings
# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
Expand All @@ -12,11 +13,6 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports

- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
Expand All @@ -28,6 +24,7 @@ repos:
hooks:
# Run the linter.
- id: ruff
args: [ '--ignore', 'E501', '--fix' ]
# Run the formatter.
- id: ruff-format

Expand Down
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].

Community Impact Guidelines were inspired by
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to the OpenAndroidInstaller project
# Contributing to the OpenAndroidInstaller project

💖 First of all: thank you for contributing to the OpenAndroidInstaller! Great that you are here!

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ poetry:
curl -sSL https://install.python-poetry.org | python3 -

install:
poetry install
poetry install --with dev
poetry run python scripts/download-tools.py
poetry run pre-commit install

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.openandroidinstaller.OpenAndroidInstaller</id>

<name>OpenAndroidInstaller</name>
<summary> Makes installing alternative Android distributions nice and easy. </summary>

<metadata_license>CC-BY-SA-4.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>

<description>
<p>
The OpenAndroidInstaller project helps Android users to keep their smartphone&apos;s operating system up to date with free software and to continue using the device even though the manufacturer no longer offers updates. With a graphical installation software, users are easily guided through the installation process of free Android operating systems like LineageOS.
</p>
</description>

<launchable type="desktop-id">org.openandroidinstaller.OpenAndroidInstaller.desktop</launchable>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version=1.0
Type=Application

Name=OpenAndroidInstaller
Comment= Makes installing alternative Android distributions nice and easy.
Comment= Makes installing alternative Android distributions nice and easy.
Categories=Utility;FileTools;

Icon=org.openandroidinstaller.OpenAndroidInstaller
Expand Down
8 changes: 2 additions & 6 deletions openandroidinstaller/app_state.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
"""This file contains a class and function to manage the app state over various steps."""

# This file is part of OpenAndroidInstaller.
# OpenAndroidInstaller is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.

# OpenAndroidInstaller is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along with OpenAndroidInstaller.
# If not, see <https://www.gnu.org/licenses/>."""
# Author: Tobias Sterbak

import copy
from pathlib import Path
from typing import List, Optional
from loguru import logger

from installer_config import _load_config, Step
from installer_config import Step, _load_config
from loguru import logger


class AppState:
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/assets/configs/FP3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ steps:
boot_recovery:
- type: confirm_button
content: >
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
- type: call_button
content: >
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/assets/configs/FP4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ steps:
boot_recovery:
- type: confirm_button
content: >
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
- type: call_button
content: >
Expand Down
10 changes: 5 additions & 5 deletions openandroidinstaller/assets/configs/akatsuki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ metadata:
maintainer: Tobias Sterbak (tsterbak)
device_name: Sony Xperia XZ3
is_ab_device: true
device_code: akatsuki
device_code: akatsuki
supported_device_codes:
- akatsuki
- akatsuki
requirements:
android: 10
steps:
Expand All @@ -21,7 +21,7 @@ steps:
- type: link_button_with_confirm
content: >
Click on the button to open the instructions on Sonys official unlocking website to generate an unlock code for your bootloader.
Once you got the code write it down somewhere and continue to input the code.
Once you got the code write it down somewhere and continue to input the code.
link: https://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader/
- type: confirm_button
content: >
Expand All @@ -37,7 +37,7 @@ steps:
command: fastboot_unlock_with_code
- type: call_button
content: >
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
Press the button to reboot. Since the device resets completely, you will need to re-enable USB debugging to continue.
Connect your device to your PC via USB. Then confirm here to continue.
command: fastboot_reboot
boot_recovery:
Expand All @@ -59,4 +59,4 @@ steps:
- type: call_button
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
command: fastboot_flash_boot
command: fastboot_flash_boot
2 changes: 1 addition & 1 deletion openandroidinstaller/assets/configs/bonito.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ steps:
img: twrp-start.jpeg
content: >
Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once your phone screen looks like the picture on the left, continue.
command: fastboot_boot_recovery
command: fastboot_boot_recovery
2 changes: 1 addition & 1 deletion openandroidinstaller/assets/configs/crosshatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ steps:
img: twrp-start.jpeg
content: >
Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once your phone screen looks like the picture on the left, continue.
command: fastboot_boot_recovery
command: fastboot_boot_recovery
1 change: 0 additions & 1 deletion openandroidinstaller/assets/configs/guacamoleb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ steps:
content: >
Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_boot_recovery

2 changes: 1 addition & 1 deletion openandroidinstaller/assets/helper.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This file is sideloaded by OpenAndroidInstaller to help with a TWRP issue on A/B-partioned devices.
Please visit https://github.com/openandroidinstaller-dev/openandroidinstaller to find out more.
Please visit https://github.com/openandroidinstaller-dev/openandroidinstaller to find out more.
Loading

0 comments on commit 2c0bbf0

Please sign in to comment.