Commit Graph

17 Commits

Author SHA1 Message Date
Fernando Lins
a7f3ffb63a PoC: evaluate SonarCloud as a code quality and coverage tool (#4996)
## Linked issue

Closes #4995

## Summary / motivation

Bedges available:

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ankitects_anki&metric=coverage)](https://sonarcloud.io/summary/new_code?id=ankitects_anki)
[![Duplicated Lines
(%)](https://sonarcloud.io/api/project_badges/measure?project=ankitects_anki&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=ankitects_anki)
[![Code
Smells](https://sonarcloud.io/api/project_badges/measure?project=ankitects_anki&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=ankitects_anki)

[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=ankitects_anki&metric=bugs)](https://sonarcloud.io/summary/new_code?id=ankitects_anki)
[![Quality Gate
Status](https://sonarcloud.io/api/project_badges/measure?project=ankitects_anki&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ankitects_anki)

[![Reliability](https://sonarcloud.io/api/project_badges/measure?project=ankitects_anki&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=ankitects_anki)

[![Security](https://sonarcloud.io/api/project_badges/measure?project=ankitects_anki&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=ankitects_anki)


**[SONAR
DASHBOARD](https://sonarcloud.io/project/overview?id=ankitects_anki)**

Integrates SonarCloud into the CI pipeline as a proof of concept to
evaluate whether
it surfaces actionable quality and security insights for this codebase.

Changes:
- Added `sonar-project.properties` configuring sources (`pylib`, `qt`,
`ts`, `rslib`)
  and coverage report paths
- Extended `tools/coverage/coverage-py` (and `.bat`) to emit
`coverage.xml` (Cobertura)
- Extended `tools/coverage/coverage-ts` (and `.bat`) to emit `lcov.info`
via the V8 provider
- Extended `tools/coverage/coverage-rust` (and `.bat`) to emit
`lcov.info` via
  `cargo-llvm-cov report`
- Added a `SonarCloud Scan` step to the `check-linux` CI job, running
after all
  checks pass and before the build cache is saved

## How to test

### Details

**1. Install sonar-scanner**
```bash
brew install sonar-scanner
```

**2. Generate and configure a token**

Go to [sonarcloud.io](https://sonarcloud.io/) → My Account → Security →
Generate Token
Copy the generated token and export it in your shell:
```
export SONAR_TOKEN=your_token_here
```

**3. Generate coverage reports**
```
just test --coverage
```
Expected output files:

 - out/coverage/python-pylib/coverage.xml
 - out/coverage/python-qt/coverage.xml
 - out/coverage/typescript/lcov.info
 - out/coverage/rust/lcov.info

**4. Run the scanner manually**
```
sonar-scanner
```
Results will appear in the SonarCloud dashboard

To test coverage generation locally:
```bash
just coverage
# verify files exist:
# out/coverage/python-pylib/coverage.xml
# out/coverage/python-qt/coverage.xml
# out/coverage/typescript/lcov.info
# out/coverage/rust/lcov.info
```
2026-08-26 15:48:45 -03:00
Abdo
8e1c571bd1 docs: Document the anki-audio package (#5411)
Some notes about updating the `anki-audio` package.
2026-08-26 21:18:43 +03:00
Abdo
c3188ebb67 docs: Fix broken links in dev docs (#5410)
## Linked issue

Closes #5335
Closes #5350

## Summary

Fix broken links in docs/ by replacing relative links (`./linux.md`)
with absolute ones (`/developers/linux`).


## How to test

Confirm all internal links in docs/ work
2026-08-26 21:17:56 +03:00
Abdo
ad88eff794 chore: Move .github/scripts/*.py to tools/ (#5375)
## Linked issue

Closes #5374

## Summary

Move .github/scripts to tools/ so they are included in static checking
and testing.

## Steps to reproduce (before)

- Make a formatting/typing error in prepare_release.py and confirm
`ninja check` does not report that.
- Modify test_validate_version.py to fail tests and confirm it's not
caught by ninja check.

## How to test (after)

The scripts should now be included in the checks as the tools/ directory
is already included by the build system.
2026-08-21 18:01:42 +03:00
Fernando Lins
5367eec660 docs: document dependabot update process (#5370)
## Linked issue

Closes #5368

## Summary / motivation

Document how maintainers should handle Dependabot PRs.
2026-08-20 13:40:29 -03:00
Abdo
3190c34d18 docs: Update e2e docs (#5331)
This moves docs/e2e-testing.md to docs-site/developers/e2e-testing.mdx
and updates some notes about the editor/congrats page.
2026-08-13 20:17:37 +03:00
znmz
625eefdd42 docs: fix typos (#5158)
closes #5160

## Summary / motivation (required)

This PR fixes typos, misspelings and (in one place) formatting in files
under `docs-site/` and one file under `docs/`.

I've found these using `codespell` and `typos` CLI utilities (+ spotted
a few myself).

## Scope

- [x] This PR is focused on one change (no unrelated edits).

***

Note: I've installed mdbook following the updated installation steps
(a4d6fb39a7),
but now i face a new error:
```rust
$ mdbook build
2026-07-15 14:48:28 [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md in "/home/user/anki-source/docs-site/src" directory
2026-07-15 14:48:28 [ERROR] (mdbook::utils): 	Caused By: No such file or directory (os error 2)
```
I don't have time right now to figure out what is the difference between
`ankitects/anki-manual` and `ankitects/anki` directory structure and how
to merge them to make the mdbook build, but *I think that my changes are
trivial enough* that no thorough testing is needed.

Co-authored-by: Abdo <abdo@abdnh.net>
2026-08-10 16:08:17 -03:00
roostwp07
ade1066690 chore: replace prepare-release workflow with local script (closes #5273) (#5288)
Closes #5273

## Summary
- Replaces `.github/workflows/prepare-release.yml` with
`.github/scripts/prepare_release.py`, a script run locally by the
maintainer
- Removes the need for the `RELEASE_TOKEN` personal access token
- Script performs the same steps: version validation, CI status check,
duplicate tag/release check, translation sync, and version commit + push

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2026-08-10 21:16:53 +03:00
Abdo
d407e47556 chore: Update Python test coverage threshold (#5299)
Decrease Python test coverage threshold after code removal in #5153

CI failure:
https://github.com/ankitects/anki/actions/runs/31246523150/job/93075937350
2026-08-10 14:47:59 -03:00
user1823
95c4e8b9a7 Docs: Add tip to disable "check on save" in Rust analyzer on low-end machines (#4489)
Anki's build scripts (ninja) set CARGO_TARGET_DIR for their own
execution. But, when running cargo commands directly (like cargo check),
those commands don't inherit that environment variable and use the
default target/ directory instead, leading to duplicate builds.

After this change, all cargo commands (check, build, test, etc.) will
use the same cache, saving storage space.
2026-08-07 06:05:36 +08:00
Luc Mcgrady
7cf1d29896 docs: Replace docs/ with symlinks (#5031)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

<!-- Fixes #123 / Closes #123 / Refs #123 -->
closes #5001

This PR replaces the contents of `docs/` with symlinks to
`docs-site/developers/`

A caveat of this is that the metadata appears at the top of the file
instead of the title.
<img width="885" height="275" alt="image"
src="https://github.com/user-attachments/assets/430f9a71-e5a5-4412-983a-e4cfd7dc4714"
/>

We could either:
- Use ninja to copy the files from docs-site/developers and convert it
from .mdx to .md (Might be a problem with the symlink approach if mdx is
added to the contributor file later)
- Leave placeholder "For contribution instructions see: (link to
mintlify site)"s in the folder, which would have to wait until the
domain of the site is set. (Probably the best solution).

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2026-08-04 22:01:31 +03:00
Abdo
22f90814e3 Add translation support for docs website (#5052)
## Linked issue

Closes #5004

## Summary

This adds intro entries for languages that have manual translations
listed under https://docs.ankiweb.net/#translations
Only placeholder pages with links to the contributor websites for now.


## How to test

Run `mint dev` under docs-site and try switching the language from the
top left.
2026-06-22 18:54:01 +03:00
Luc Mcgrady
a6b2457a42 docs: use relative links (#5048)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

closes #5011


All the "apps.ankiweb.net" Are broken in the form that they currently
exist which makes it difficult to confirm my changes would link to the
correct files so I've left them as they are in this pr.

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2026-06-22 13:18:45 +03:00
Luc Mcgrady
e9ac48cac2 Docs: Set up Prettier for formatting Mintlify website (#5020)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

closes #5018
<!-- Fixes #123 / Closes #123 / Refs #123 -->

## Summary / motivation (required)

This prevents large diffs with prettier being used with the mintlify
editor

A caveat of this is that the docs generated by cog now have to be
prettier compatible. Also for some reason prettier has problems with the
{/* */} multi-line comment format so we have to use <!-- --> instead.

Sadly I don't have a good way to check that the Prettier config does not
differ between this PR and the editor.

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2026-06-17 15:54:11 +03:00
Abdo
0d7b3fdd96 feat: Remove the uv launcher and old packaging code (#5019)
## Linked issue

Closes #4556
Closes #4557
Closes #4144
Closes #4151
Closes #4152
Closes #4153
Closes #4229
Closes #4356
Closes #4401
Closes #4403
Closes #4519
Closes #4523
Closes #4390
Closes #4414
Closes #4484



## Summary / motivation

After 4 months of exploring Briefcase for packaging, we're confident it
solves most problems with the uv launcher with less complexity and at a
lower maintenance cost, especially with the parallel work on the release
CI, which we already used to make 5 releases.

This also removes platform-specific packaging/signing code used to
produce macOS dmg files and Windows NSIS installers, which is now
largely handled by Briefcase and the release CI.
The custom install scripts for Linux are mostly preserved under
qt/installer/linux-template and used in the Briefcase build.

## How to test

- [ ] No build problems.
- [ ] The `tools/build-installer` scripts still work.
- [ ] No CI/release workflow issues.
- [ ] No user-visible changes in dev environment and Briefcase build.
2026-06-17 03:02:52 +03:00
Luc Mcgrady
2fcaa56023 Docs: use "Getting started" as manual index page (#5013)
- Updated docs-site/manual/getting-started.mdx
- Deleted docs-site/manual/index.mdx
- Updated docs-site/docs.json

Mintlify-Source: dashboard-editor

Please note that the Mintlify editor seems to make formatting changes to
files which it edits which makes this diff large than necessary.

closes #5000 

Uses the introduction / getting started pages as the index for each
category rather than a list of links.

Also re-introduces some pages that were missing from the FAQ to use as
the index as well.

I'm sorry about the large diff but mintlify makes formatting changes
when you use the editor.

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-06-16 14:24:48 +03:00
Andrew Sanchez
fb0215a2c1 Prototype unified Mintlify docs site (#4882)
## Summary

- add a generated `docs-site/` Mintlify proof of concept for a unified
Anki docs site
- migrate the desktop manual, AnkiMobile docs, FAQs, add-on docs,
translation docs, release notes, legacy docs, and repo-local Sphinx/MyST
developer docs into the POC tree
- add a migration helper that preserves mdBook ordering, handles common
MDX incompatibilities, and regenerates the landing-page-inspired
Mintlify styling
- apply minimal styling based on the current Anki landing page: Anki
logo, Hanken Grotesk, blue primary color, subtle surfaces, and compact
nav treatment

## Validation

- `uv run --with ty ty check tools/mintlify_poc_migrate.py`
- `source ~/.nvm/nvm.sh && nvm use 22.15.0 && mint validate`
- previewed locally with `mint dev --port 3000` and checked the home
page/developer docs in browser

## Notes

This is intentionally a draft POC. It does not remove the existing
Sphinx or mdBook docs flows yet; it demonstrates what bringing the
sources into this repo and building from a single Mintlify root could
look like.

---------

Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com>
Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>
Co-authored-by: Abdo <abdo@abdnh.net>
2026-06-12 16:27:33 +03:00