tools: improve changelog helper; finish 0.4.1 changelogs

This commit is contained in:
Alexander Medvednikov 2023-09-03 22:40:26 +03:00
parent ae4fe20b5e
commit 84f70c56a0
2 changed files with 157 additions and 84 deletions

View file

@ -2,16 +2,18 @@
*3 September 2023* *3 September 2023*
#### Improvements in the language #### Improvements in the language
- Do not allow uninitialized function pointers
- Fix compiling V programs with latest clang 16 on windows (clang 16 is stricter than clang 14) (#19095)
ast, checker, cgen: implement enum static `from_string(name string)` (#19156)
- Pure `array.sorted()` and `array.sorted_with_compare()` methods, that do not modify their receivers (#19251) - Pure `array.sorted()` and `array.sorted_with_compare()` methods, that do not modify their receivers (#19251)
- UB overflow has been removed - UB overflow has been removed
- Implement `Enum.from_string(name string)` for converting strings to enum values (#19156)
- Disallow casting string to enum, suggest using Enum.from_string() instead (#19260) - Disallow casting string to enum, suggest using Enum.from_string() instead (#19260)
- Use autocasting in complex conditions (#18839)
- Allow alias as fixed array on return (#18817)
- Do not allow uninitialized function pointers
- Fix compiling V programs with latest clang 16 on windows (clang 16 is stricter than clang 14) (#19095)
- Fix anonymous struct with default expr (#19257) - Fix anonymous struct with default expr (#19257)
- log: improve the most common use case, it's no longer necessary to create a `Log` instance (#19242)
- Allow using consts as enum values (#19193) - Allow using consts as enum values (#19193)
- `@[attr]` syntax to replace `[attr]` (`[]` is used for too many things). Most likely to be replaced with `@attr()` in the futre. - `@[attr]` syntax to replace `[attr]` (`[]` is used for too many things). Most likely to be replaced with `@attr()` in the future.
- Allow `none` for not first values on map initialization (#18821)
- Make all .trace() methods generic on the type of the passed expression - Make all .trace() methods generic on the type of the passed expression
#### Breaking changes #### Breaking changes
@ -47,26 +49,35 @@ ast, checker, cgen: implement enum static `from_string(name string)` (#19156)
- Disallow an empty `chan` type (#19167) - Disallow an empty `chan` type (#19167)
#### Parser improvements #### Parser improvements
- parser: change warn to error, for const names with upper letter (fix #18838) (#18840) - Change warn to error, for const names with upper letter (fix #18838) (#18840)
- parser: disallow declaring static functions as method receivers (#19007) - Disallow declaring static functions as method receivers (#19007)
- parser: disallow having builtin type as type names for `enum`, `sum type` and `alias` (#19043) - Disallow having builtin type as type names for `enum`, `sum type` and `alias` (#19043)
- parser: support `const x := 123`, to make extracting locals as constants less annoying while prototyping - Support `const x := 123`, to make extracting locals as constants less annoying while prototyping
- parser: fix struct field fn type with default value (fix #19099) (#19106) - Fix struct field fn type with default value (fix #19099) (#19106)
- parser, cgen: fix `for i++; i<10; i++ {` (fix #18445) (#19035) - Fix `for i++; i<10; i++ {` (fix #18445) (#19035)
- parser, checker, cgen: fix fn return alias of fixed array (#19116) - Fix fn return alias of fixed array (#19116)
- Ast, parser, cgen: fix generic struct init (Stack[&Person]{}) (fix #19119) (#19122) - Fix generic struct init (Stack[&Person]{}) (fix #19119) (#19122)
- v.token: add inline next_to() and cleanup related calls (#19226)
#### Compiler internals #### Compiler internals
- pref: make -autofree work without -gc none
- builder,pref: allow thirdparty objects compilation with CPP compiler (#19124)
- scanner: fix string interpolation with nested string interpolation in inner quotes p. 3 (#19121) - scanner: fix string interpolation with nested string interpolation in inner quotes p. 3 (#19121)
- scanner: error early on an unsupported escape sequence in a string, like `\_` (fix #19131) (#19134) - scanner: error early on an unsupported escape sequence in a string, like `\_` (fix #19131) (#19134)
- v.token: add inline next_to() and cleanup related calls (#19226)
#### Standard library #### Standard library
- eventbus: add generic support for event name (#18805)
- readline: add support for ctlr+w and ctrl+u shortcuts (#18921)
- strconv.atoi: fix string.int() returning numbers for non number characters (fix #18875) (#18925)
- builtin: reduce the number of array allocations for consts in all V programs (#18889)
- builtin: move array.data to the top of the struct
- os.notify: implement the kqueue backend for notify.FdNotifier (#19057)
- vlib: add a new module `builtin.wchar`, to ease dealing with C APIs that accept `wchar_t*` (#18794) - vlib: add a new module `builtin.wchar`, to ease dealing with C APIs that accept `wchar_t*` (#18794)
- arrays: add more util functions and tests for them - find_first, find_last, join_to_string (#18784) - arrays: add more util functions and tests for them - find_first, find_last, join_to_string (#18784)
- vlib: use sync.new_mutex() consistently for initialising all vlib structures containing mutex fields - vlib: use sync.new_mutex() consistently for initialising all vlib structures containing mutex fields
- crypto.pem: add a static method `Block.new`, to replace `new` (#18846) - crypto.pem: add a static method `Block.new`, to replace `new` (#18846)
- crypto.pem: add decode_only and general improvements to decoding (#18908) - crypto.pem: add decode_only and general improvements to decoding (#18908)
- log: improve the most common use case, it's no longer necessary to create a `Log` instance (#19242)
- crypto.sha512: make the new384/0, new512_256/0, new512_224/0 functions public - crypto.sha512: make the new384/0, new512_256/0, new512_224/0 functions public
- json: fix option alias support (#18801) - json: fix option alias support (#18801)
- time: fix `parse_format` with `YY` (#18887) - time: fix `parse_format` with `YY` (#18887)
@ -90,6 +101,14 @@ ast, checker, cgen: implement enum static `from_string(name string)` (#19156)
- toml: Add generic automatic decoding and encoding of simple structs, when they don't implement custom methods (#17970) - toml: Add generic automatic decoding and encoding of simple structs, when they don't implement custom methods (#17970)
#### Web #### Web
- http: Request.host
- net.ftp: fix dir() for file names, which contain spaces (fix #18800) (#18804)
- net.http: make listener public, and add addr in Server struct (#18871)
- net.http.chunked: return `!string` on decode (#18928)
- net.conv: rename functions to match other langs, making them easier t… (#18937)
- wasm: remove dependency on thirdparty/binaryen, webassembly backend rewrite (#18120)
- wasm: add a -wasm-stack-top flag to compiler (#19157)
- net.mbedtls: add SSLListener to allow creating SSL servers (#19022)
- picoev, picohttparser: reimplement in V (#18506) - picoev, picohttparser: reimplement in V (#18506)
- vweb: fix parsing of form fields, send with multipart/form-data (by JS fetch) - vweb: fix parsing of form fields, send with multipart/form-data (by JS fetch)
- vweb: make vweb route paths case sensitive (#18973) - vweb: make vweb route paths case sensitive (#18973)
@ -98,8 +117,8 @@ ast, checker, cgen: implement enum static `from_string(name string)` (#19156)
- vweb: add a user_agent utility method to the vweb context (#19204) - vweb: add a user_agent utility method to the vweb context (#19204)
- vweb: avoid the controllers having to be defined in specific order (#19182) - vweb: avoid the controllers having to be defined in specific order (#19182)
#### ORM #### ORM
- orm: fix inserting sequential values (id=0), in tables with an i64 primary field (#18791)
- Add OR in where on update and delete (#19172) - Add OR in where on update and delete (#19172)
#### Database drivers #### Database drivers
@ -109,6 +128,7 @@ ast, checker, cgen: implement enum static `from_string(name string)` (#19156)
- db.sqlite: make functions return results, breaking change (#19093) - db.sqlite: make functions return results, breaking change (#19093)
#### Native backend #### Native backend
- native: move functions out of amd64.v (#18857)
#### C backend #### C backend
- Fix selector code to use interface method table on closure when needed (#18736) - Fix selector code to use interface method table on closure when needed (#18736)
@ -134,9 +154,9 @@ ast, checker, cgen: implement enum static `from_string(name string)` (#19156)
- Fix comptime assign with generic result return type (#19192) - Fix comptime assign with generic result return type (#19192)
- Fix match with comptime if expr in branch (#19189) - Fix match with comptime if expr in branch (#19189)
#### Comptime
#### Tools #### Tools
- ci: add v-analyzer builds (#18835)
- ci: cleanup more the contents of the generated v_linux.zip, v_macos.zip, and v_windows.zip, use -skip-unused
- tools: fix vcomplete for zsh (#18950) - tools: fix vcomplete for zsh (#18950)
- tools: support a toc for projects, with single exposing module, in `v doc` (#19001) - tools: support a toc for projects, with single exposing module, in `v doc` (#19001)
- Add support for `v should-compile-all -c examples/`, which will delete all the produced executables at the end - Add support for `v should-compile-all -c examples/`, which will delete all the produced executables at the end
@ -150,26 +170,6 @@ ast, checker, cgen: implement enum static `from_string(name string)` (#19156)
- v.builder: show the number of files, types, modules, when a program is compiled with -stats - v.builder: show the number of files, types, modules, when a program is compiled with -stats
- Improve the output of parser_speed.v and scanner_speed.v - Improve the output of parser_speed.v and scanner_speed.v
## V 0.4 ## V 0.4
*1 July 2023* *1 July 2023*

View file

@ -18,12 +18,9 @@ enum Category {
comptime comptime
tools tools
compiler_internals compiler_internals
examples
} }
//__global (
// lines []Line
//)
struct Line { struct Line {
category Category category Category
text string text string
@ -31,10 +28,11 @@ struct Line {
const log_txt = 'log.txt' const log_txt = 'log.txt'
__global ( struct App {
counter = 0 total_lines int
total_lines = 0 mut:
) counter int
}
fn main() { fn main() {
if !os.exists(log_txt) { if !os.exists(log_txt) {
@ -42,14 +40,16 @@ fn main() {
} }
lines := os.read_lines(log_txt)! lines := os.read_lines(log_txt)!
changelog_txt := os.read_file('CHANGELOG.md')!.to_lower() changelog_txt := os.read_file('CHANGELOG.md')!.to_lower()
mut app := &App{
total_lines: lines.len
}
// mut counter := 0 // to display how many commits are left // mut counter := 0 // to display how many commits are left
for line in lines { for line in lines {
s := line.trim_space() s := line.trim_space()
if s == '' { if s == '' {
counter++ app.counter++
} }
} }
total_lines = lines.len
// println('${counter} / ${lines.len}') // println('${counter} / ${lines.len}')
for line in lines { for line in lines {
s := line.to_lower() s := line.to_lower()
@ -60,12 +60,21 @@ fn main() {
continue continue
} }
process_line(line)! app.process_line(line)!
} }
println('done.') println('done.')
} }
fn process_line(text string) ! { fn (mut app App) process_line(text string) ! {
if text == '' {
return
}
semicolon_pos := text.index(': ') or {
println('no `:` in commit, skipping: "${text}"')
return
}
prefix := text[..semicolon_pos]
// Get category based on keywords in the commit message/prefix
mut category := Category.improvements mut category := Category.improvements
if text.contains('checker:') { if text.contains('checker:') {
category = .checker category = .checker
@ -75,7 +84,9 @@ fn process_line(text string) ! {
category = .db category = .db
} else if is_stdlib(text) { } else if is_stdlib(text) {
category = .stdlib category = .stdlib
} else if text.contains('vweb:') { } else if is_orm(text) {
category = .orm
} else if is_web(text) {
category = .web category = .web
} else if is_tools(text) { } else if is_tools(text) {
category = .tools category = .tools
@ -85,7 +96,13 @@ fn process_line(text string) ! {
category = .compiler_internals category = .compiler_internals
} else if is_improvements(text) { } else if is_improvements(text) {
category = .improvements category = .improvements
} else if is_native(text) {
category = .native
} else if is_examples(text) {
// TODO maybe always skip these as well?
category = .examples
} else if text.contains('docs:') || text.contains('doc:') { } else if text.contains('docs:') || text.contains('doc:') {
// Always skip docs
delete_processed_line_from_log(text)! delete_processed_line_from_log(text)!
return return
} }
@ -95,12 +112,7 @@ fn process_line(text string) ! {
} }
// Trim everything to the left of `:` for some commits (e.g. `checker: `) // Trim everything to the left of `:` for some commits (e.g. `checker: `)
semicolon_pos := text.index(': ') or {
println('no : in commit, skipping')
return
}
mut s := text mut s := text
prefix := text[..semicolon_pos]
// println("PREFIX='${prefix}'") // println("PREFIX='${prefix}'")
// if true { // if true {
// exit(0) // exit(0)
@ -111,7 +123,7 @@ fn process_line(text string) ! {
// Get input from the user // Get input from the user
print('\033[H\033[J') print('\033[H\033[J')
println('${counter} / ${total_lines}') println('${app.counter} / ${app.total_lines}')
// println('\n') // println('\n')
println(text) println(text)
input := os.input('${category} ?') input := os.input('${category} ?')
@ -149,7 +161,7 @@ fn process_line(text string) ! {
} }
else {} else {}
} }
counter++ app.counter++
// Don't forget to remove the line we just processed from log.txt // Don't forget to remove the line we just processed from log.txt
delete_processed_line_from_log(text)! delete_processed_line_from_log(text)!
} }
@ -228,6 +240,25 @@ fn delete_processed_line_from_log(line string) ! {
os.write_file(log_txt, new_text)! os.write_file(log_txt, new_text)!
} }
const db_strings = [
'db:',
'db.sqlite',
'db.mysql',
'db.pg',
]
const improvements_strings = [
'vfmt:',
'fmt:',
'all:',
'v:',
]
const parser_strings = [
'parser:',
'ast:',
]
const stdlib_strings = [ const stdlib_strings = [
'gg:', 'gg:',
'json:', 'json:',
@ -244,33 +275,15 @@ const stdlib_strings = [
'toml:', 'toml:',
'vlib:', 'vlib:',
'arrays:', 'arrays:',
] 'math.',
'os.',
const db_strings = [ 'term:',
'db:', 'sync.',
'db.sqlite', 'builtin:',
'db.mysql', 'strconv',
] 'readline',
'cli:',
const internal_strings = [ 'eventbus:',
'scanner:',
'transformer:',
]
const improvements_strings = [
'vfmt:',
'fmt:',
'all:',
]
const tools_strings = [
'tools:',
'vpm:',
]
const parser_strings = [
'parser:',
'ast:',
] ]
fn is_stdlib(text string) bool { fn is_stdlib(text string) bool {
@ -281,6 +294,22 @@ fn is_db(text string) bool {
return is_xxx(text, db_strings) return is_xxx(text, db_strings)
} }
const orm_strings = [
'orm:',
]
fn is_orm(text string) bool {
return is_xxx(text, orm_strings)
}
const internal_strings = [
'scanner:',
'transformer:',
'builder:',
'pref:',
'v.util',
]
fn is_internal(text string) bool { fn is_internal(text string) bool {
return is_xxx(text, internal_strings) return is_xxx(text, internal_strings)
} }
@ -289,6 +318,27 @@ fn is_improvements(text string) bool {
return is_xxx(text, improvements_strings) return is_xxx(text, improvements_strings)
} }
const examples_strings = [
'example',
'tests',
'readme:',
'.md:',
]
fn is_examples(text string) bool {
return is_xxx(text, examples_strings)
}
const tools_strings = [
'tools:',
'vpm:',
'ci',
'github:',
'gitignore',
'benchmark',
'v.help:',
]
fn is_tools(text string) bool { fn is_tools(text string) bool {
return is_xxx(text, tools_strings) return is_xxx(text, tools_strings)
} }
@ -297,6 +347,29 @@ fn is_parser(text string) bool {
return is_xxx(text, parser_strings) return is_xxx(text, parser_strings)
} }
const web_strings = [
'vweb:',
'websocket:',
'picoev:',
'mbedtls',
'net:',
'net.',
'wasm:',
'http:',
]
fn is_web(text string) bool {
return is_xxx(text, web_strings)
}
const native_strings = [
'native:',
]
fn is_native(text string) bool {
return is_xxx(text, native_strings)
}
fn is_xxx(text string, words []string) bool { fn is_xxx(text string, words []string) bool {
for s in words { for s in words {
if text.contains(s) { if text.contains(s) {