Welcome! Log In Create A New Profile

Advanced

Style(core): fix the incorrect front spaces to unite style.

Jim T
May 20, 2020 12:32AM
Hello!

Nginx is famous for code readability and neat code format. I use the tool(
https://github.com/openresty/openresty-devel-utils) to try to unify the
incorrect front spaces, Here is my attempt at core.

# HG changeset patch
# User Jinhua Tan <312841925@qq.com>
# Date 1589948492 -28800
# Wed May 20 12:21:32 2020 +0800
# Node ID 10678810de74edc4c02d5cd7303f0099eee9fac3
# Parent 3c8082c3f98ab7fdec8a598b55609701452b5254
Style(core): fix the incorrect front spaces to unite style.

diff -r 3c8082c3f98a -r 10678810de74 src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c Wed May 13 22:02:47 2020 +0800
+++ b/src/core/ngx_conf_file.c Wed May 20 12:21:32 2020 +0800
@@ -544,8 +544,8 @@
}

ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "unexpected end of file, "
- "expecting \";\" or \"}\"");
+ "unexpected end of file, "
+ "expecting \";\" or \"}\"");
return NGX_ERROR;
}

@@ -1047,9 +1047,9 @@

} else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%s\" in \"%s\" directive, "
- "it must be \"on\" or \"off\"",
- value[1].data, cmd->name.data);
+ "invalid value \"%s\" in \"%s\" directive, "
+ "it must be \"on\" or \"off\"",
+ value[1].data, cmd->name.data);
return NGX_CONF_ERROR;
}

diff -r 3c8082c3f98a -r 10678810de74 src/core/ngx_cycle.c
--- a/src/core/ngx_cycle.c Wed May 13 22:02:47 2020 +0800
+++ b/src/core/ngx_cycle.c Wed May 20 12:21:32 2020 +0800
@@ -1308,9 +1308,9 @@

if (tag != shm_zone[i].tag) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the shared memory zone \"%V\" is "
- "already declared for a different use",
- &shm_zone[i].shm.name);
+ "the shared memory zone \"%V\" is "
+ "already declared for a different use",
+ &shm_zone[i].shm.name);
return NULL;
}

diff -r 3c8082c3f98a -r 10678810de74 src/core/ngx_file.c
--- a/src/core/ngx_file.c Wed May 13 22:02:47 2020 +0800
+++ b/src/core/ngx_file.c Wed May 20 12:21:32 2020 +0800
@@ -1005,7 +1005,7 @@
name = ngx_de_name(&dir);

ngx_log_debug2(NGX_LOG_DEBUG_CORE, ctx->log, 0,
- "tree name %uz:\"%s\"", len, name);
+ "tree name %uz:\"%s\"", len, name);

if (len == 1 && name[0] == '.') {
continue;
diff -r 3c8082c3f98a -r 10678810de74 src/core/ngx_log.c
--- a/src/core/ngx_log.c Wed May 13 22:02:47 2020 +0800
+++ b/src/core/ngx_log.c Wed May 20 12:21:32 2020 +0800
@@ -121,7 +121,7 @@

/* pid#tid */
p = ngx_slprintf(p, last, "%P#" NGX_TID_T_FMT ": ",
- ngx_log_pid, ngx_log_tid);
+ ngx_log_pid, ngx_log_tid);

if (log->connection) {
p = ngx_slprintf(p, last, "*%uA ", log->connection);
@@ -385,8 +385,8 @@
ngx_open_file_n " \"%s\" failed", name);
#if (NGX_WIN32)
ngx_event_log(ngx_errno,
- "could not open error log file: "
- ngx_open_file_n " \"%s\" failed", name);
+ "could not open error log file: "
+ ngx_open_file_n " \"%s\" failed", name);
#endif

ngx_log_file.fd = ngx_stderr;
diff -r 3c8082c3f98a -r 10678810de74 src/core/ngx_regex.c
--- a/src/core/ngx_regex.c Wed May 13 22:02:47 2020 +0800
+++ b/src/core/ngx_regex.c Wed May 20 12:21:32 2020 +0800
@@ -111,8 +111,8 @@
if (re == NULL) {
if ((size_t) erroff == rc->pattern.len) {
rc->err.len = ngx_snprintf(rc->err.data, rc->err.len,
- "pcre_compile() failed: %s in \"%V\"",
- errstr, &rc->pattern)
+ "pcre_compile() failed: %s in
\"%V\"",
+ errstr, &rc->pattern)
- rc->err.data;

} else {
diff -r 3c8082c3f98a -r 10678810de74 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Wed May 13 22:02:47 2020 +0800
+++ b/src/core/ngx_resolver.c Wed May 20 12:21:32 2020 +0800
@@ -3265,8 +3265,8 @@
}

ngx_log_debug3(NGX_LOG_DEBUG_CORE, r->log, 0,
- "resolver qt:%ui cl:%ui len:%uz",
- type, class, len);
+ "resolver qt:%ui cl:%ui len:%uz",
+ type, class, len);

i += sizeof(ngx_resolver_an_t);

Thanks!
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Style(core): fix the incorrect front spaces to unite style.

Jim T 51 May 20, 2020 12:32AM

Re: Style(core): fix the incorrect front spaces to unite style.

Maxim Dounin 13 May 20, 2020 09:50AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready