Skip to content

Commit

Permalink
Janitor: Remove trailing whitespaces from all files
Browse files Browse the repository at this point in the history
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
  • Loading branch information
ogoffart committed Jan 10, 2025
1 parent 938b254 commit 3e94bd2
Show file tree
Hide file tree
Showing 127 changed files with 289 additions and 290 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ body:
Be as detailed as possible:
- What problem does this feature solve, or what use case does it address?
- How would this feature improve your workflow or product?
Feel free to add code sample. You can format it in markdown within ```` ```slint ```` tags.
Feel free to add code sample. You can format it in markdown within ```` ```slint ```` tags.
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ updates:
- "*" # Group all Actions updates into a single larger pull request
ignore:
- dependency-name: "lukka/run-cmake"


- package-ecosystem: "npm" # See documentation for possible values
open-pull-requests-limit: 20
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/autofix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
components: rustfmt
target: aarch64-linux-android
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2
uses: biomejs/setup-biome@v2
- name: Rust format
run: cargo fmt --
- name: C++ format
Expand Down Expand Up @@ -69,4 +69,4 @@ jobs:
- run: sudo apt-get install pipx
- run: pipx install reuse
- name: Check reuse compliance
run: cargo xtask check_reuse_compliance
run: cargo xtask check_reuse_compliance
4 changes: 2 additions & 2 deletions .github/workflows/cpp_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Prepare licenses
run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild
working-directory: api/cpp/
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
run: cmake -B build -S . -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.cmake_system_processor }} -DRust_CARGO_TARGET=${{ matrix.rust_target}} -DCMAKE_C_COMPILER=${{ matrix.gcc_target }}-gcc -DCMAKE_CXX_COMPILER=${{ matrix.gcc_target }}-g++ -DSLINT_COMPILER=download ${{ env.SLINT_BINARY_FEATURES }} ${{ inputs.extra_cmake_flags }}
- name: CMake build
run: cmake --build build --parallel
- name: CMake package
- name: CMake package
working-directory: build
run: cpack -G TGZ
- name: "Upload C++ packages"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ jobs:
if: github.event.inputs.release == 'true'
working-directory: www-releases/releases
run: cat versions.json

- name: Update version in versions.json
if: github.event.inputs.release == 'true'
working-directory: www-releases/releases
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_npm_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ jobs:
target: ${{ matrix.rust-target }}
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
run: choco upgrade llvm
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tree_sitter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
inputs:
tag:
type: string
description: tree sitter release tag to use
description: tree sitter release tag to use
latest:
type: boolean
description: Use the latest tree-sitter release
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/upload_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
if: runner.os == 'Linux'
if: runner.os == 'Linux'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
Expand All @@ -52,7 +52,7 @@ jobs:
perl -pi -e 's,^default =.*,,' Cargo.toml
perl -pi -e 's,# binaries:,,' Cargo.toml
echo "New defaults:"
grep "^\s*default =" Cargo.toml
grep "^\s*default =" Cargo.toml
- name: Build a binary wheel
uses: PyO3/maturin-action@v1
with:
Expand All @@ -64,7 +64,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: python-package-distributions-${{ matrix.platform.runner }}-${{ strategy.job-index }}
path: api/python/wheelhouse/*.whl
path: api/python/wheelhouse/*.whl

build_source_package:
name: Build source package
Expand All @@ -88,7 +88,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: python-package-distributions-source
path: api/python/dist/*.tar.gz
path: api/python/dist/*.tar.gz

publish-to-test-pypi:
if: ${{ github.event.inputs.release != 'true' }}
Expand All @@ -100,13 +100,13 @@ jobs:
name: testpypi
url: https://test.pypi.org/p/slint
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
with:
pattern: python-package-distributions-*
path: dist
merge-multiple: true
merge-multiple: true
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -122,13 +122,13 @@ jobs:
name: pypi
url: https://test.pypi.org/p/slint
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
with:
pattern: python-package-distributions-*
path: dist
merge-multiple: true
merge-multiple: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Discussions](https://img.shields.io/github/discussions/slint-ui/slint)](https://github.com/slint-ui/slint/discussions)

Slint is a declarative GUI toolkit to build native user interfaces for embedded,
desktop, and mobile applications written in Rust, C++, JavaScript, or Python.
desktop, and mobile applications written in Rust, C++, JavaScript, or Python.

The name *Slint* is derived from our design goals:

Expand Down Expand Up @@ -220,7 +220,7 @@ located remotely in Germany.
- Follow [@slint-ui](https://www.linkedin.com/company/slint-ui/) on LinkedIn.
- Follow [@slint.dev](https://bsky.app/profile/slint.dev) on Bluesky
- Subscribe to our [YouTube channel](https://www.youtube.com/@Slint-UI)

### Contact us

Feel free to join [Github discussions](https://github.com/slint-ui/slint/discussions)
Expand Down
2 changes: 1 addition & 1 deletion api/cpp/docs/generated_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export component SampleComponent inherits Window {
// note that dashes will be replaced by underscores in the generated code
in-out property<string> user_name;
callback hello;
public function do-something(x: int) -> bool { return x > 0; }
public function do-something(x: int) -> bool { return x > 0; }
// ... maybe more elements here
}
Expand Down
10 changes: 5 additions & 5 deletions api/cpp/docs/mcu/stm32/generic.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ as well as the peripherals of our board.
```cmake
# Locate Slint
find_package(Slint)
# Compile app-window.slint to app-window.h and app-window.cpp
slint_target_sources(your-target app-window.slint)
# Embed images and fonts in the binary
# Embed images and fonts in the binary
set_target_properties(your-target PROPERTIES SLINT_EMBED_RESOURCES embed-for-software-renderer)
# Replace $BSP_NAME with the name of your concrete BSP,
# for example stm32h735g_discovery.
target_compile_definitions(your-target PRIVATE
SLINT_STM32_BSP_NAME=$BSP_NAME
)
# Link Slint run-time library
target_link_libraries(your-target PRIVATE
Slint::Slint
Expand All @@ -68,7 +68,7 @@ as well as the peripherals of our board.
#include <stdio.h>
#include <stm32h735g_discovery.h>
#include <stm32h735g_discovery_lcd.h>
#include <stm32h735g_discovery_ts.h>
#include <stm32h735g_discovery_ts.h>
#include "app-window.h"
Expand Down
2 changes: 1 addition & 1 deletion api/cpp/docs/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The follow table summarizes the entire mapping:
structure A :code:`class` of the same name The order of the data member are in the same as in the slint declaration
anonymous object A :code:`std::tuple` The fields are in alphabetical order.
enum An :code:`enum class` The values are always converted to CamelCase. The order of the values is the same as in the declaration.
:code:`Point` :cpp:class:`slint::LogicalPosition` A struct with :code:`x` and :code:`y` fields, representing logical coordinates.
:code:`Point` :cpp:class:`slint::LogicalPosition` A struct with :code:`x` and :code:`y` fields, representing logical coordinates.
=========================== =================================== =======================================================================================================================================
```
## Structures
Expand Down
2 changes: 1 addition & 1 deletion api/node/__test__/api.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ test("loadFile enum", (t) => {

test("file loader", (t) => {
const testSource = `export component Test {
in-out property <string> text: "Hello World";
in-out property <string> text: "Hello World";
}`;
const demo = loadFile(
path.join(dirname, "resources/test-fileloader.slint"),
Expand Down
4 changes: 2 additions & 2 deletions api/node/__test__/js_value_conversion.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ test("wrong callback return type ", (t) => {
export struct Person {
name: string,
age: int,
}
export component App {
callback get-string() -> string;
Expand Down Expand Up @@ -938,7 +938,7 @@ test("wrong global callback return type ", (t) => {
name: string,
age: int,
}
export global Global {
export global Global {
callback get-string() -> string;
callback get-int() -> int;
callback get-bool() -> bool;
Expand Down
2 changes: 1 addition & 1 deletion api/node/__test__/resources/test-enum.slint
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export enum TestEnum {
}

export component Test {
in-out property <TestEnum> check;
in-out property <TestEnum> check;
}
2 changes: 1 addition & 1 deletion api/node/__test__/resources/test-struct.slint
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export struct TestStruct {
}

export component Test {
in-out property <TestStruct> check;
in-out property <TestStruct> check;
}
2 changes: 1 addition & 1 deletion api/node/cover.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ await demo.run();
This is your main TypeScript entry point:
* Import the Slint API as an [ECMAScript module](https://nodejs.org/api/esm.html#modules-ecmascript-modules) module.
* Import the Slint API as an [ECMAScript module](https://nodejs.org/api/esm.html#modules-ecmascript-modules) module.
* Invoke `loadFile()` to compile and load the `.slint` file.
* Instantiate the `Demo` component declared in `main.slint`.
* Run it by showing it on the screen and reacting to user input.
Expand Down
2 changes: 1 addition & 1 deletion api/python/tests/test_timers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def quit_after_two_invocations():
if counter == 2:
native.quit_event_loop()

test_timer = native.Timer()
test_timer = native.Timer()
test_timer.start(native.TimerMode.Repeated, timedelta(milliseconds=100), quit_after_two_invocations)
native.run_event_loop()
test_timer.stop()
Expand Down
2 changes: 1 addition & 1 deletion api/rs/slint/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
//! ```sh
//! cargo install cargo-apk
//! ```
//!
//!
//! Build and run your application with the following command:
//!
//! ```sh
Expand Down
4 changes: 2 additions & 2 deletions demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ These demos showcase different complex use-cases for building UIs with Slint.



| Thumbnail | Description | Demo |
| --- | --- | --- |
| Thumbnail | Description | Demo |
| --- | --- | --- |
| [Printer UI ![Printer Demo image](https://github.com/user-attachments/assets/7e7400ad-283a-4404-b04a-8620ba4df452)](./printerdemo) | A fictional user interface for the touch screen of a printer. <br/> [Project...](./printerdemo) | [Wasm Demo](https://slint.dev/snapshots/master/demos/printerdemo/) |
| [Energy Meter![Energy meter demo image](https://github.com/user-attachments/assets/abfe03e3-ded6-4ddc-82b7-8303ee45515c "Energy meter demo image")](./energy-monitor/) | A fictional user interface of a device that monitors energy consumption in a building. <br/> [Project...](./energy-monitor) | [Wasm Demo](https://slint.dev/snapshots/master/demos/energy-monitor/) |
| [Weather![Weather demo image](./weather-demo/docs/img/desktop-preview.png "7 GUI's demo image")](./weather-demo/) | A simple, cross-platform (Desktop, Android, Wasm) weather application using real weather data from the [OpenWeather](https://openweathermap.org/) API. <br/> [Project...](./weather-demo/) | [Wasm Demo](https://slint.dev/snapshots/master/demos/weather-demo/) |
Expand Down
14 changes: 7 additions & 7 deletions demos/home-automation/ui/appState.slint
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export global AppState {
callback showFullScreen(int);
showFullScreen(index)=> {
full-screen-index = index;

if full-screen-index != -1 {
last-selected-index = index;
showing-full-screen = true;
Expand Down Expand Up @@ -81,7 +81,7 @@ export global AppState {
{ id: "graph1", name:"Humidity",type: WidgetType.graph },
{ id: "graph2", name:"Pressure",type: WidgetType.graph },
{ id: "control1", name:"Music",type: WidgetType.music },
{ id: "control2", name:"Front Camera",type: WidgetType.camera },
{ id: "control2", name:"Front Camera",type: WidgetType.camera },
{ id: "control3", name:"Alarm",type: WidgetType.alarm },
{ id: "control4", name:"Heating / Air Conditioning",type: WidgetType.hvac },
];
Expand Down Expand Up @@ -448,10 +448,10 @@ export global AppState {
{ id: "nav", x: 36.031, y: 0.445, width: 1848.0, height: 121.0, background: #8d8d8d, visible: true },
]
},





];
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export component InnerShadowRectangle inherits Rectangle {
in property <brush> inner-shadow-color: Palette.shadow-color;
in property <bool> nine-slice: true;
clip: true;
if nine-slice:
if nine-slice:
Rectangle {
clip: true;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion demos/home-automation/ui/components/general/toggle.slint
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export component DropShadowToggle inherits Rectangle {
}
]
background: inner-shadow-color;

// CONTROL BUTTON
TouchArea {
enabled: touchEnabled;
Expand Down
2 changes: 1 addition & 1 deletion demos/home-automation/ui/components/lamp.slint
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export component Lamp inherits Control {
}
}
}

slider := FancySlider {
maxValue: 24;
value: self.maxValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export component WidgetLoader {

changed data => {
if root.show != self.data.visible {
// hiding then set the position so it fades in on the correct place
// hiding then set the position so it fades in on the correct place
if !root.show {
targetX = self.data.x * 1px;
targetY = self.data.y * 1px;
Expand Down
1 change: 0 additions & 1 deletion demos/home-automation/ui/demo-debug.slint
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ export component AppWindow inherits Window {
initial-door-state: open;
}
}

Loading

0 comments on commit 3e94bd2

Please sign in to comment.