Skip to content

Commit

Permalink
Ignore formatting of restricted platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Sep 9, 2024
1 parent 7631e3a commit 8b861b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmd/tools/vfmt.v
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ fn (foptions &FormatOptions) vlog(msg string) {

fn parse_others_in_same_module(mod_name string, file string, mut table ast.Table, prefs &pref.Preferences) {
if mod_name != 'main' && prefs.should_compile_c(file) && !file.ends_with('.c.v')
&& !file.starts_with('.#') && !file.contains('_d_') && !file.contains('_notd_') {
&& !file.ends_with('_windows.v') && !file.starts_with('.#') && !file.contains('_d_')
&& !file.contains('_notd_') {
// other files in the same module also need to be parsed
cur_file_dir := os.dir(file)
mut files := os.ls(cur_file_dir) or { panic(err) }
Expand Down
2 changes: 1 addition & 1 deletion vlib/os/filepath_windows.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module os
pub fn windows_volume(path string) string {
volume_len := win_volume_len(path)
if volume_len == 0 {
return os.empty_str
return empty_str
}
return path[..volume_len]
}
3 changes: 2 additions & 1 deletion vlib/v/fmt/fmt_keep_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ fn run_fmt(mut input_files []string) {

fn parse_others_in_same_module(mod_name string, file string, mut table ast.Table, prefs &pref.Preferences) {
if mod_name != 'main' && prefs.should_compile_c(file) && !file.ends_with('.c.v')
&& !file.starts_with('.#') && !file.contains('_d_') && !file.contains('_notd_') {
&& !file.ends_with('_windows.v') && !file.starts_with('.#') && !file.contains('_d_')
&& !file.contains('_notd_') {
// other files in the same module also need to be parsed
cur_file_dir := os.dir(file)
mut files := os.ls(cur_file_dir) or { panic(err) }
Expand Down

0 comments on commit 8b861b2

Please sign in to comment.