Skip to content

Commit

Permalink
fmt md files
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Aug 7, 2024
1 parent 634b282 commit d83c5f7
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 84 deletions.
2 changes: 1 addition & 1 deletion cmd/tools/vdoc/html.v
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn (mut vd VDoc) create_search_results(mod string, dn doc.DocNode, out Output) {
dn_description := trim_doc_node_description(dn.name, comments)
vd.search_index << dn.name
vd.search_data << SearchResult{
prefix : if dn.parent_name != '' {
prefix: if dn.parent_name != '' {
'${dn.kind} (${dn.parent_name})'
} else {
'${dn.kind} '
Expand Down
9 changes: 4 additions & 5 deletions cmd/tools/vvet/vvet.v
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ fn main() {
vet_options := cmdline.options_after(os.args, ['vet'])
mut vt := Vet{
opt: Options{
is_werror : '-W' in vet_options
is_verbose : '-verbose' in vet_options || '-v' in vet_options
show_warnings : '-hide-warnings' !in vet_options && '-w' !in vet_options
use_color : '-color' in vet_options
|| (term_colors && '-nocolor' !in vet_options)
is_werror : '-W' in vet_options
is_verbose : '-verbose' in vet_options || '-v' in vet_options
show_warnings: '-hide-warnings' !in vet_options && '-w' !in vet_options
use_color : '-color' in vet_options || (term_colors && '-nocolor' !in vet_options)
doc_private_fns_too: '-p' in vet_options
}
}
Expand Down
32 changes: 16 additions & 16 deletions doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1600,9 +1600,9 @@ fn (mut t MyTime) century() int {
fn main() {
mut my_time := MyTime{
year: 2020
year : 2020
month: 12
day: 25
day : 25
}
println(time.new(my_time).utc_string())
println('Century: ${my_time.century()}')
Expand Down Expand Up @@ -2436,7 +2436,7 @@ fn register(u User) User {
mut user := User{
name: 'abc'
age: 23
age : 23
}
user = register(user)
println(user)
Expand Down Expand Up @@ -2464,9 +2464,9 @@ struct Button {
fn new_button(c ButtonConfig) &Button {
return &Button{
width: c.width
width : c.width
height: c.height
text: c.text
text : c.text
}
}
Expand Down Expand Up @@ -2535,7 +2535,7 @@ struct Book {
book := Book{
author: struct {
name: 'Samantha Black'
age: 24
age : 24
}
}
assert book.author.name == 'Samantha Black'
Expand Down Expand Up @@ -2681,7 +2681,7 @@ output :
```
Button{
Size: Size{
width: 3
width : 3
height: 2
}
title: 'Click me'
Expand All @@ -2701,7 +2701,7 @@ You can also initialize an embedded struct:
```v oksyntax
mut button := Button{
Size: Size{
width: 3
width : 3
height: 2
}
}
Expand All @@ -2711,7 +2711,7 @@ or assign values:

```v oksyntax
button.Size = Size{
width: 4
width : 4
height: 5
}
```
Expand Down Expand Up @@ -4588,7 +4588,7 @@ struct User {
mut data := map[string]int{}
user := &User{
name: 'Pierre'
name : 'Pierre'
score: 1024
}
Expand Down Expand Up @@ -5157,26 +5157,26 @@ sql db {
// insert a new customer:
new_customer := Customer{
name: 'Bob'
country: 'uk'
name : 'Bob'
country : 'uk'
nr_orders: 10
}
sql db {
insert new_customer into Customer
}!
us_customer := Customer{
name: 'Martin'
country: 'us'
name : 'Martin'
country : 'us'
nr_orders: 5
}
sql db {
insert us_customer into Customer
}!
none_country_customer := Customer{
name: 'Dennis'
country: none
name : 'Dennis'
country : none
nr_orders: 2
}
sql db {
Expand Down
4 changes: 2 additions & 2 deletions tutorials/building_a_simple_web_blog_with_vweb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ fn main() {
first_article := Article{
title: 'Hello, world!'
text: 'V is great.'
text : 'V is great.'
}
second_article := Article{
title: 'Second post.'
text: 'Hm... what should I write about?'
text : 'Hm... what should I write about?'
}
sql app.db {
Expand Down
6 changes: 3 additions & 3 deletions vlib/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import cli
fn main() {
mut app := cli.Command{
name: 'example-app'
name : 'example-app'
description: 'example-app'
execute: fn (cmd cli.Command) ! {
execute : fn (cmd cli.Command) ! {
println('hello app')
return
}
commands: [
cli.Command{
name: 'sub'
name : 'sub'
execute: fn (cmd cli.Command) ! {
println('hello subcommand')
return
Expand Down
2 changes: 1 addition & 1 deletion vlib/db/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import db.mysql
// Create connection
mut connection := mysql.Connection{
username: 'root'
dbname: 'mysql'
dbname : 'mysql'
}
// Connect to server
connection.connect()?
Expand Down
4 changes: 2 additions & 2 deletions vlib/dl/loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const default_paths = [
fn main() {
mut dl_loader := loader.get_or_create_dynamic_lib_loader(
key: 'LibExample'
key : 'LibExample'
env_path: 'LIB_PATH'
paths: default_paths
paths : default_paths
)!
defer {
Expand Down
14 changes: 7 additions & 7 deletions vlib/encoding/csv/README_csv_reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ import encoding.csv
fn main() {
file_path := 'big2.csv'
mut csvr := csv.csv_reader(
file_path: file_path // path to the file CSV
file_path : file_path // path to the file CSV
mem_buf_size: 1024 * 1024 * 64 // we set 64MByte of buffer for this file
end_line_len: csv.endline_crlf_len // we are using a windows text file
)!
Expand Down Expand Up @@ -295,9 +295,9 @@ a,b,c
fn main() {
mut csvr := csv.csv_reader(
scr_buf: txt.str
scr_buf : txt.str
scr_buf_len: txt.len
comment: `#` // line starting with # will be ignored
comment : `#` // line starting with # will be ignored
)!
// scan all rows, csvr.csv_map.len contain the valid
// rows number in the CSV file.
Expand Down Expand Up @@ -328,10 +328,10 @@ const txt = "
fn main() {
mut csvr := csv.csv_reader(
scr_buf: txt.str // string pointer
scr_buf_len: txt.len // string length
comment: `#` // line starting with # will be ignored
quote: `'` // char used for quotes
scr_buf : txt.str // string pointer
scr_buf_len : txt.len // string length
comment : `#` // line starting with # will be ignored
quote : `'` // char used for quotes
quote_remove: true // remove quotes from the cells
)!
Expand Down
2 changes: 1 addition & 1 deletion vlib/flag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn main() {
// Generate and layout (a configuable) documentation for the flags
documentation := flag.to_doc[Config](
version: '1.0' // NOTE: this overrides the `@[version: '1.2.3']` struct attribute
fields: {
fields : {
'level': 'This is a doc string of the field `level` on struct `Config`'
'example': 'This is another doc string'
'multi': 'This flag can be repeated'
Expand Down
8 changes: 4 additions & 4 deletions vlib/gg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import gx
fn main() {
mut context := gg.new_context(
bg_color: gx.rgb(174, 198, 255)
width: 600
height: 400
bg_color : gx.rgb(174, 198, 255)
width : 600
height : 400
window_title: 'Polygons'
frame_fn: frame
frame_fn : frame
)
context.run()
}
Expand Down
6 changes: 3 additions & 3 deletions vlib/term/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ fn frame(x voidptr) {
fn main() {
mut app := &App{}
app.tui = tui.init(
user_data: app
event_fn: event
frame_fn: frame
user_data : app
event_fn : event
frame_fn : frame
hide_cursor: true
)
app.tui.run()!
Expand Down
12 changes: 6 additions & 6 deletions vlib/time/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ println(time.now())
import time
const time_to_test = time.Time{
year: 1980
month: 7
day: 11
hour: 21
minute: 23
second: 42
year : 1980
month : 7
day : 11
hour : 21
minute : 23
second : 42
nanosecond: 123456789
}
Expand Down
6 changes: 3 additions & 3 deletions vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ pub fn new_checker(table &ast.Table, pref_ &pref.Preferences) &Checker {
timers_should_print = true
}
mut checker := &Checker{
table : table
pref : pref_
timers : util.new_timers(
table : table
pref : pref_
timers: util.new_timers(
should_print: timers_should_print
label : 'checker'
)
Expand Down
4 changes: 2 additions & 2 deletions vlib/veb/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ fn main() {
pub fn (mut app App) register_user(mut ctx Context, name string, password string) veb.Result {
salt := auth.generate_salt()
new_user := User{
name: name
name : name
password_hash: auth.hash_password_with_salt(password, salt)
salt: salt
salt : salt
}
sql app.db {
insert new_user into User
Expand Down
6 changes: 3 additions & 3 deletions vlib/vweb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ fn get_session(mut ctx vweb.Context) bool {
// implement your own logic to get the user
user := User{
session_id: '123456'
name: 'Vweb'
name : 'Vweb'
}
// set the user
Expand Down Expand Up @@ -854,7 +854,7 @@ fn main() {
mut db := sqlite.connect('db')!
mut app := &App{
db: db
db : db
controllers: [
vweb.controller('/admin', &Admin{
db: db
Expand Down Expand Up @@ -898,7 +898,7 @@ fn main() {
pool := vweb.database_pool(handler: get_database_connection)
mut app := &App{
db_handle: pool
db_handle : pool
controllers: [
vweb.controller('/admin', &Admin{
db_handle: pool
Expand Down
2 changes: 1 addition & 1 deletion vlib/x/json2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mut:
fn main() {
mut person := Person{
name: 'Bob'
name : 'Bob'
birthday: time.now()
}
person_json := json2.encode[Person](person)
Expand Down
Loading

0 comments on commit d83c5f7

Please sign in to comment.