Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] Add prefix G_ to global static variables (#3336) #3338

Merged
merged 1 commit into from
Apr 13, 2022
Merged

[refactor] Add prefix G_ to global static variables (#3336) #3338

merged 1 commit into from
Apr 13, 2022

Conversation

liby
Copy link
Contributor

@liby liby commented Apr 12, 2022

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: #3336

Other information

Motivation

P.NAM.09 定义全局静态变量时需加前缀G_以便和常量有所区分

Undetermined part

vm/transaction-builder-generator/src/csharp.rs
vm/transaction-builder-generator/src/dart.rs
vm/transaction-builder-generator/src/java.rs
check_commit.sh output
Diff in /starcoin/config/src/lib.rs at line 55:
 pub use genesis_config::{
     BuiltinNetworkID, ChainNetwork, ChainNetworkID, FutureBlockParameter,
     FutureBlockParameterResolver, GenesisBlockParameter, GenesisBlockParameterConfig,
-    GenesisConfig, G_DEV_CONFIG, G_HALLEY_CONFIG, G_LATEST_GAS_SCHEDULE, G_MAIN_CONFIG, G_PROXIMA_CONFIG,
-    G_TEST_CONFIG,
+    GenesisConfig, G_DEV_CONFIG, G_HALLEY_CONFIG, G_LATEST_GAS_SCHEDULE, G_MAIN_CONFIG,
+    G_PROXIMA_CONFIG, G_TEST_CONFIG,
 };
 pub use logger_config::LoggerConfig;
 pub use metrics_config::MetricsConfig;
Diff in /starcoin/config/src/metrics_config.rs at line 179:
         self.generate_address();

         if !self.disable_metrics() {
-            let registry = Registry::new_custom(Some(G_DEFAULT_METRIC_NAMESPACE.to_string()), None)?;
+            let registry =
+                Registry::new_custom(Some(G_DEFAULT_METRIC_NAMESPACE.to_string()), None)?;
             self.registry = Some(registry);
         }

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #3338 (1aeb4c3) into master (d07e82d) will increase coverage by 0.21%.
The diff coverage is 43.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3338      +/-   ##
==========================================
+ Coverage   31.86%   32.07%   +0.21%     
==========================================
  Files         500      500              
  Lines       46785    46786       +1     
  Branches    21228    21228              
==========================================
+ Hits        14902    15000      +98     
+ Misses      17808    17687     -121     
- Partials    14075    14099      +24     
Flag Coverage Δ
unittests 32.07% <43.68%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
account/service/src/service.rs 17.47% <0.00%> (ø)
block-relayer/src/block_relayer.rs 16.32% <0.00%> (+0.53%) ⬆️
cmd/faucet/src/web.rs 0.00% <0.00%> (ø)
cmd/starcoin/src/cli_state.rs 48.79% <0.00%> (-4.87%) ⬇️
cmd/starcoin/src/dev/tests.rs 14.96% <0.00%> (+1.33%) ⬆️
commons/accumulator/src/node.rs 75.95% <0.00%> (ø)
commons/accumulator/src/node_index.rs 89.95% <ø> (ø)
commons/logger/src/structured_log.rs 3.93% <0.00%> (ø)
commons/scmd/src/context.rs 0.00% <0.00%> (ø)
commons/utils/src/metrics.rs 0.00% <0.00%> (ø)
... and 135 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d07e82d...1aeb4c3. Read the comment docs.

@LemonHX
Copy link
Member

LemonHX commented Apr 13, 2022

@liby please resolve conflicts

@liby
Copy link
Contributor Author

liby commented Apr 13, 2022

@liby please resolve conflicts

PTAL

@LemonHX
Copy link
Member

LemonHX commented Apr 13, 2022

@liby wait ci to pass then I will approve it

@LemonHX
Copy link
Member

LemonHX commented Apr 13, 2022

@liby fmt prob again

@liby
Copy link
Contributor Author

liby commented Apr 13, 2022

@liby fmt prob again

Already ready.

config/src/metrics_config.rs Outdated Show resolved Hide resolved
@jolestar jolestar merged commit 5e34b4e into starcoinorg:master Apr 13, 2022
@liby liby deleted the feature/improve-the-global-static-variable-naming-convention branch April 13, 2022 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants