format

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2025 PRAS

Index

Constants

This section is empty.

Variables

View Source
var FormatCmd = &cobra.Command{
	Use:  "format",
	Long: "Automatically format QML source files to ensure consistent style and readability.",
	Run: func(cmd *cobra.Command, args []string) {
		if !utilsIsPackageInstalled("qmlformat") {
			fmt.Println(color.YellowString("format command is disabled due to missing qmlformat dependency."))
			fmt.Println(color.BlueString("- Use `prasmoid fix` to install it."))
			return
		}

		if !utilsIsValidPlasmoid() {
			fmt.Println(color.RedString("Current directory is not a valid plasmoid."))
			return
		}

		crrPath, _ := os.Getwd()
		relPath := filepath.Join(crrPath, dir)
		if watch {
			prettifyOnWatch(relPath, make(chan bool))
		} else {
			prettify(relPath)
		}
	},
}

FormatCmd represents the format command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL