offa / android-foss

A list of Free and Open Source Software (FOSS) for Android – saving Freedom and Privacy.
https://offa.github.io/android-foss/
GNU General Public License v3.0
6.23k stars 276 forks source link

Make a python script to check wether all categories are sorted or not #462

Closed Ammar64 closed 2 weeks ago

Ammar64 commented 2 weeks ago

I made a python script to ensure all categories are sorted.
Currently all it does is to report unsorted categories.

it currently outputs this

Category Battery is not sorted
Category Browser is not sorted
Category Email Clients is not sorted
Category File Sharing is not sorted
Category Image Manipulation is not sorted
Category Maps & Navigation is not sorted
Category RSS Readers is not sorted
Category System is not sorted
Category ToDo Lists is not sorted
Category URL Manipulation is not sorted
Category Utilities is not sorted
Category Wallpapers is not sorted
Category Weather is not sorted
Category Miscellaneous is not sorted
Category Word is not sorted

so check those categories

TODOS

Ammar64 commented 2 weeks ago

Now outputs this

Show output ``` Category Battery is not sorted App batterybot pro is not in the correct order Should be sorted as follows: acca battery tool batterybot pro bcl savertuner Category Browser is not sorted App foss browser is not in the correct order Should be sorted as follows: cromite duckduckgo privacy browser einkbro fennec ffupdater foss browser fulguris web browser idiomreplacex browser app lightning monocles browser orbot privacy browser smartcookieweb tor browser Category Email Clients is not sorted App thunderbird is not in the correct order Should be sorted as follows: fairemail k-9 mail ltt.rs thunderbird tutanota Category File Sharing is not sorted App zorin connect is not in the correct order Should be sorted as follows: cryptomator custom uploader device connect filester ftpclient kde connect localsend sharex sharik sharing snapdrop & pairdrop for android warpinator zorin connect Category Image Manipulation is not sorted App imagepipe is not in the correct order Should be sorted as follows: easy watermark exif thumbnail adder ffshare image toolbox imagepipe metadata remover privacyblur scrambled exif superimage Category Maps & Navigation is not sorted App μlogger is not in the correct order Should be sorted as follows: compass gmaps wv opentopomap viewer organic maps osmand~ private location trail sense trekarta vespucci μlogger Category RSS Readers is not sorted App readyou is not in the correct order Should be sorted as follows: aggregator feeder handynewsreader newsblur nunti readrops readyou thud Category System is not sorted App cpu info is not in the correct order Should be sorted as follows: appmanager ashell you auditor autopie busybox installer canta captive portal controller cpu info dark theme de-bloater dhizuku droidfs dsu sideloader geto inure app manager (trial) libchecker logfox network survey nix-on-droid pcapdroid permission pilot revanced manager scoop superfreezz systemui tuner termux treble info upgradeall wifianalyzer Category ToDo Lists is not sorted App todolist is not in the correct order Should be sorted as follows: 1list everyday tasks opentasks orgzly pocketplan tasks.org todolist Category URL Manipulation is not sorted App léon is not in the correct order Should be sorted as follows: linksheet léon tarnhelm untracker untrackme urlcheck Category Utilities is not sorted App voice notify is not in the correct order Should be sorted as follows: amaze file utilities avnc bendystraw bettercounter cams connectbot converter now data monitor databackup deadhash etchdroid extirpater hexviewer invizible pro json list keep alive key mapper keystoreviewer neo backup nfcgate ocr ooni probe open video editor orgro pdf converter screen time sd maid 2/se sensorkraken sms import / export track & graph tts util voice notify volta Category Wallpapers is not sorted App wallman is not in the correct order Should be sorted as follows: dark mode live wallpaper doodle gif live wallpaper materials live wallpaper palette-cycle paperize peristyle slideshow wallpaper wall you wallflow wallman wave lines live wallpaper zade's wallpaper Category Weather is not sorted App clima is not in the correct order Should be sorted as follows: breezy weather bura cirrus clima forecastie overmorrow weather radarweather rain weather Category Miscellaneous is not sorted App dékadico is not in the correct order Should be sorted as follows: apple flinger ball2box burger party destination sol dooz dékadico endless sky falling blocks minetest open golf pocket broomball quinb wordlesolver xeonjia zoysii Category Word is not sorted App lexica is not in the correct order Should be sorted as follows: acvtool android app permissions by izzysoft android debloat list apatch apk editor studio apk2url apklab apktool apktoolgui awesome android cellularprivacy – recommendations crosswords f-droid forkyz fossdroid guardian project gurgle izzyondroid f-droid repository kernelsu lexica list of free and open-source android applications magisk orangefox recovery ota on rooted device pitch black recovery project skyhawk recovery project twrp universal android debloater gui ```

Is it good ?

Ammar64 commented 2 weeks ago

Now it does this image

Ammar64 commented 2 weeks ago

image it seems like it looks for ensure_sorted.py in this repo instead of the fork.
Merge and test it.

Ammar64 commented 2 weeks ago

Categories names should be written either this way ## – <Category name> – or this way ### • <Category name>

offa commented 2 weeks ago

Nice! :+1:

The workflow_dispatch shouldn't be needed I guess as the others should cover the use cases already.

Ammar64 commented 2 weeks ago

workflow_dispatch removed

offa commented 2 weeks ago

So here we go! :smile:

Thank you! :-)

Ammar64 commented 2 weeks ago

@offa unfortunately it still can't find the python file even after merge I wonder why? image

offa commented 2 weeks ago

Me too :sweat_smile:

offa commented 2 weeks ago

Ah, checkout is missing … I'll give it a try.

Update

File is found now, but there's a syntax error:

  File "/home/runner/work/android-foss/android-foss/ensure_sorted.py", line 96
    print(f'        {bcolors.RED if color else ''}{unsorted[j]}{bcolors.ENDC if color else ''}{((longest_str-len(unsorted[j]))+2) * ' '}{bcolors.GREEN if color else ''}{sorted[j]}{bcolors.ENDC if color else ''}')
                                                                                                                                                                                                                   ^
SyntaxError: f-string: expecting '}'
Ammar64 commented 2 weeks ago

Ah string quotations inside {} needs python 3.12
I'll fix it

offa commented 2 weeks ago

I have another fixed added to ci branch.

offa commented 2 weeks ago

Further fixes in #463.