Commit graph

228 commits

Author SHA1 Message Date
linsui
5354661fb4 fix typo 2022-10-05 06:15:53 +00:00
FestplattenSchnitzel
580ce85412 [lint] Fix comparisons in check_updates_expected 2022-09-14 10:10:20 +00:00
FestplattenSchnitzel
d32e53798d
[lint] Check if checking for updates makes no sense 2022-09-12 12:27:38 +02:00
Licaon_Kter
543c9fc77f Update approved official SPDX license tags 2022-08-04 10:45:41 +00:00
Benedikt Brückmann
675d034ac7 Fix errors from merge and review 2021-06-25 06:42:17 +02:00
Benedikt Brückmann
9038161b70 apply numpy docstyle 2021-06-25 06:28:47 +02:00
Benedikt Brückmann
1e943a22df rewrite docstrings to match numpy style guide 2021-06-25 06:28:47 +02:00
Jochen Sprickerhof
46ebdd701a [lint] convert path to Path first
Fixes a lot of undetected extlibs.
Regression of 6bafb036.
2021-06-09 17:49:59 +02:00
linsui
6bafb036ee lint.py: use pathlib and support Windows 2021-06-09 15:46:52 +08:00
Jochen Sprickerhof
49248ba3a9 [lint] only check for https with UpdateCheckMode HTTP
With 133b626b UpdateCheckMode is now also allowed with Tags but it uses
the files from the local repo.
2021-06-07 18:55:42 +02:00
fossdd
bcdefccb31 Revert removing Licenses 2021-02-10 19:10:14 +00:00
fossdd
8371a2e07a Update SPDX License List 2021-02-08 15:14:28 +00:00
Hans-Christoph Steiner
fff59e5197 only use AutoName: in checkupdates
AutoName: is only needed for the commit messages generated by checkupdates,
and it makes the logic for localized names confusing.

closes #654
refs #304
2021-01-14 20:36:09 +01:00
Hans-Christoph Steiner
0f6b638986 common.get_app_display_name() for finding app names 2021-01-14 20:34:15 +01:00
Hans-Christoph Steiner
bf25b4ca03 eliminate app.builds everywhere, it should be app['Builds']
The .txt format was the last place where the lowercase "builds" was used,
this converts references everywhere to be "Builds".  This makes it possible
to load metadata YAML files with any YAML parser, then have it possible to
use fdroidserver methods on that data, like metadata.write_metadata().

The test files in tests/metadata/dump/*.yaml were manually edited by cutting
the builds: block and putting it the sort order for Builds: so the contents
should be unchanged.

```
sed -i \
 -e 's/app\.builds/app.get('Builds', \[\])/g' \
 -e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
 -e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
 -e "s/app\.get(Builds, \[\])/app.get('Builds', \[\])/g" \
 -e "s/app\.get('Builds', \[\])\.append/app\['Builds'\].append/g" \
 -e "s/app\['builds'\]/app.get('Builds', [])/g" \
 */*.*
```
2020-12-15 08:55:05 +01:00
Hans-Christoph Steiner
129438fd30 make read_metadata only parse files actually used by lint/rewritemeta
Now that the description formatting is removed, there is no need to load
all of the app metadata before operating on a single one.  This change
makes lint and rewritemeta only load the metadata for the apps it is actually
operating on.  Before, it would always load all metadata files.  #845

closes #678
2020-12-08 09:37:49 +01:00
Hans-Christoph Steiner
828d6015ef purge code that modifies the app description, including linkifying
closes #845
2020-12-08 09:37:49 +01:00
Hans-Christoph Steiner
fede58a710 use ArgumentParser's own "usage" line in help output 2020-10-01 23:01:55 +02:00
Hans-Christoph Steiner
b23cf9f8ad use YAML names for referring to metadata fields in messages 2020-10-01 23:01:55 +02:00
Hans-Christoph Steiner
5e1377c77a standardize on "Application ID" in UI text 2020-10-01 23:01:55 +02:00
Hans-Christoph Steiner
0b92e60266 handle file type detection using Pythonic methods
This ditches the custom common.get_extension() for straight core Python
methods.  This should make the code closer to Python conventions.  For
example, pathlib also includes the "." in the extension it returns.
2020-08-24 17:05:49 +02:00
Michael Pöhn
f5a5fffb10 purge accepted_formats from config 2020-08-20 20:40:15 +02:00
Hans-Christoph Steiner
62c8fd5999
add Liberapay: field with username as data
Liberapay was originally included using a numeric ID, since they had
not yet finalized the public URLs.  Now it is a username.  So this
logic prefers the username in Liberapay: field, and keeps the old
LiberapayID: to ease migration.  LiberapayID: will not override
Liberapay:.  Clients are expected to prefer Liberapay: over LiberapayID:
2020-06-16 15:35:28 +02:00
Hans-Christoph Steiner
b2daf96284 lint: fix pyflakes 2020-06-02 22:05:18 +02:00
Hans-Christoph Steiner
6c5887e906
lint: make --force-yamllint error if yamllint is not installed
https://gitlab.com/fdroid/fdroidserver/-/merge_requests/753#note_353829401
2020-06-02 21:56:05 +02:00
Hans-Christoph Steiner
410901d3bd Merge branch 'yamllint' into 'master'
yamllint

See merge request fdroid/fdroidserver!721
2020-05-14 12:36:19 +00:00
Hans-Christoph Steiner
df563d339a
fix pep8 E741 ambiguous variable name 'l' 2020-05-14 12:11:36 +02:00
Michael Pöhn
810a6587df add --force-yamllint option to lint 2020-04-25 17:39:23 +02:00
Michael Pöhn
b076e8cba7 add srclib spec parser 2020-04-25 17:22:48 +02:00
Michael Pöhn
ed2c5f6f5b run yamllint on srclibs when running 'fdroid lint' 2020-04-25 15:57:21 +02:00
Michael Pöhn
4e69ff582f run yamllint when parsing failed and also on fdroid lint runs 2020-04-24 15:47:31 +02:00
Hans-Christoph Steiner
a72904ee23
lint: allow Beerware and XSkat licenses
These licenses were already in our repo.  The are not FSF- or OSI-approved,
but they are included in Debian.  So for now at least, we should maintain
them in our list until we have a clearer picture of how we should make the
list of licenses we support.

* fdroidserver!682
* https://github.com/spdx/license-list-XML/issues/876
* Beerware in Debian:
  https://metadata.ftp-master.debian.org/changelogs//main/libm/libmd/libmd_1.0.1-3_copyright
* XSkat in Debian:
  https://metadata.ftp-master.debian.org/changelogs//main/x/xskat/xskat_4.0-7_copyright
2019-10-07 12:05:37 +02:00
Hans-Christoph Steiner
1ef4f74aff lint: include MIT-CMU, it is so close to FSF/OSI-free MIT
fdroidserver!682

https://github.com/spdx/license-list-data/issues/53

* FSF lists two closely related variants as  X11 or Expat, search for "MIT license" in https://www.gnu.org/licenses/license-list.html
* X11 is considered free: https://directory.fsf.org/wiki/License:X11
* Expat is considered free: https://directory.fsf.org/wiki/License:Expat
* It is included in Debian, so it is DFSG-free: https://metadata.ftp-master.debian.org/changelogs//main/f/flite/flite_2.1-release-3_copyright
* Fedora considers it free https://fedoraproject.org/wiki/Licensing:MIT#CMU_Style
2019-10-04 11:30:24 +02:00
Hans-Christoph Steiner
3801db064a lint: improve HTTPS check
It was missing some domains, so I added another rule.  @IzzySoft pointed
out it was redudnant, so this removes the redudant rule and fixes the
original.

https://gitlab.com/fdroid/fdroidserver/merge_requests/681/diffs#note_225263464
2019-10-04 11:12:48 +02:00
Hans-Christoph Steiner
af4e231f7d lint: enforce HTTPS on GitHub and GitLab pages
The always provide HTTPS, so let's enforce it.
2019-10-04 11:12:48 +02:00
Hans-Christoph Steiner
17320c23f4 lint: don't trip up on projects with 'master' in the name
https://gitlab.com/fdroid/fdroiddata/merge_requests/5557#note_223283359
2019-10-04 11:12:48 +02:00
Michael Pöhn
d5ab303d83 lint: license override config option + require FSF/OSI approved licenses by default 2019-10-02 22:14:09 +02:00
Michael Pöhn
3c9535d64b lint: fsf approved licenses only 2019-10-02 12:15:02 +02:00
Hans-Christoph Steiner
aa47e93f36 Revert "Revert "lint: check if CurrentVersion is older than oldest build entry""
This reverts commit a5ec1703c9.

fdroid/fdroiddata@42bb872b46
2019-01-21 23:00:33 +01:00
Marcus Hoffmann
a5ec1703c9 Revert "lint: check if CurrentVersion is older than oldest build entry"
This reverts commit 78473e7dab.

This is currently blocked by some apps in fdroiddata being reset to a
broken state.
2019-01-10 14:48:52 +01:00
Marcus Hoffmann
e1c547cfdf Revert "Revert "Merge branch 'random-fixes' into 'master'""
This reverts commit f6f2fb0b89.

Only one of the included commit should have been reverted.
2019-01-10 14:48:29 +01:00
Marcus
f6f2fb0b89 Revert "Merge branch 'random-fixes' into 'master'"
This reverts merge request !605
2019-01-10 13:46:49 +00:00
Hans-Christoph Steiner
76b026e572 lint: check whether the locale was included in an f-droid.org URL 2019-01-03 21:00:01 +01:00
Hans-Christoph Steiner
78473e7dab lint: check if CurrentVersion is older than oldest build entry
This causes F-Droid to never install this app, except for manually via the
Versions list in AppDetails.
2019-01-03 21:00:01 +01:00
Hans-Christoph Steiner
85993eb2f8 lint: check fields for proper type, e.g. list vs. string
fdroid/fdroidserver#578
2018-10-09 23:31:24 +02:00
Hans-Christoph Steiner
9d12b1dc61 add strict, tested validation of Android/F-Droid package names
Android has stricter rules than Java for Package Names, but anything the
Python regex thinks is valid must be valid according to Java's rules too.

https://developer.android.com/studio/build/application-id
2018-09-07 14:17:39 +02:00
Licaon_Kter
da0c541dec Lint - the error should hint that the right word is Categories 2018-07-30 22:56:57 +00:00
Marcus Hoffmann
f4bb76f3a4
lint: update spdx tags to v4.0.0 2018-05-16 22:36:39 +02:00
Hans-Christoph Steiner
8f30c892c5 VercodeOperation: only allow simple math expresssions and %c 2018-03-05 09:45:58 +01:00
Marcus Hoffmann
c81d5da953
lint: fix update check data https check
The urlver field can be '.', this was not considered in
26bfd7fb28.
2018-03-02 23:56:49 +01:00