Clone this repo:
  1. d088ce3 fetch-and-push-remote: Extend sync parameters by Karsten Tausche · 6 months ago main rel/11/fp3/8901.4.A.0027 rel/11/fp3/8901.4.A.0028 rel/13/fp3/6.A.023 rel/13/fp3/6.A.025 rel/11/fp3/8901.4.A.0027.1 rel/11/fp3/8901.4.A.0028.1 rel/13/fp3/6.A.023.1 rel/13/fp3/6.A.025.0
  2. 9da5fcf Add git-compare-histories by Karsten Tausche · 8 months ago rel/11/fp3/8901.4.A.0026 rel/11/fp3/8901.4.A.0026.1
  3. 862e883 gdrive: Add download_file_by_id command by Luca Weiss · 7 months ago
  4. 4009866 gdrive: Show parents when listing files by Luca Weiss · 7 months ago
  5. 399104e fetch-and-push-remote: Fix push-current-upstream-rev on mirrors by Karsten Tausche · 8 months ago rel/13/fp3/6.A.022 rel/13/fp3/6.A.022.1

Fairphone Android tools

A collection of tools developed at Fairphone related to Android development:

  • Standalone scripts live in bin.
  • Installable libraries live in their own directory within <language>-libs:
    • python-libs/android-tools: A support library to work with Android devices and apps in Python 3.
    • shell-libs: A collection of shell scripts for handling common shell commands and operations.
  • Installable tools live in their own directory:
    • bullseye: Script to check and apply security patches from Android Security Bulletins.
    • gdrive-client: Minimal Google Drive client for uploading files via service accounts.
    • lava: tools to interact with LAVA, the automated testing system.
    • jira: Script to import CSV defined configuration into the Fairphone JIRA instance. The script can create users, groups and components. Run ./import_csv_to_jira.py --help for details.

See the individual tools help (--help) or projects README for installation and usage.

Developing

Code style, linters, and formatters must be used before submitting any new tool or patchset. Maximal line lengths are fixed to 80 characters.

Install the selected toolset within a Python 3.8 or newer (virtual) environment:

virtualenv -p python3 .venv/fp-tools
. .venv/fp-tools/bin/activate
pip install -r requirements-dev.txt

We detail below the recommendations (read: requirements) per language and how to run the tools in a standalone fashion.

Bash/Shell (.sh)

Note: Portable shell scripts are favoured over Bash scripts.

Follow what the Bashate style checker recommends.

bashate --verbose <file>

Python (.py)

Note: Python 3.8 is the current development choice.

Let Black format Python files for you.

black <file>

Trust that the linting tools (flake8 and pylint) know better and follow their advice.

flake8 <file>
pylint <file>

Additionally, run mypy for validating type hinting. However, this does not fit in all contexts and mypy has limitations in specific situations. Consider using type hints unless it is too hard of a burden. If using type hints, also consider using mypy's strict mode. It provides extra checks, including calls from typed contexts to untyped ones etc.

mypy [--strict] <file>

License

The project is made available under the terms of the Apache 2.0 license. See LICENSE for details.