Skip to content

Commit 49df4fc

Browse files
committed
Removed refs to --rules #29
1 parent 65e4335 commit 49df4fc

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ _mx_ and _rimutaka_ are the same person. Let's add both emails to StackMuncher c
9494
GitHub validation: not set
9595

9696
Local stack reports: /home/ubuntu/rust/stm_app/reports/home_ubuntu_rust_stm_app_6213a4b2
97-
Code analysis rules: /home/ubuntu/rust/stm_app/stm_rules
9897
Config file: /home/ubuntu/rust/stm_app/.stm_config/config.json
9998
```
10099
The app stored two emails from `--emails` param in its config file and printed its full config info (`config` command). From now on it will look for commits from _[email protected]_ and _[email protected]_.
@@ -181,14 +180,12 @@ Example:
181180
GitHub validation: https://gist.github.com/rimutaka/fb8fc0f87ee78231f064131022c8154a
182181
183182
Local stack reports: /home/ubuntu/rust/stm_app/reports
184-
Code analysis rules: /home/ubuntu/rust/stm_app/stm_rules
185183
Config file: /home/ubuntu/rust/stm_app/.stm_config/config.json
186184
```
187185

188186
#### Debug settings
189187

190188
* `--log error|warn|info|debug|trace`: the log is written to _stdout_. Defaults to `error` for least verbose output. Redirect the output to a file or _null device_ to completely silence it. E.g. `stackmuncher --log debug >> ~/stm_trace.log`
191-
* `--rules "path to code analysis rules"`: a path to an alternative location of code analysis rules. The path can be relative or absolute. Defaults to the application folder.
192189
* `--reports "path to reports folder"`: a path to an alternative location for saving stack reports. The path can be relative or absolute. Defaults to the application folder.
193190
* `--config "path to config folder"`: a path to an alternative location of the config folder. The path can be relative or absolute. Defaults to the application folder.
194191

@@ -202,12 +199,11 @@ Example:
202199
_The current version of the app is at alpha-stage and should be used for testing purposes only._
203200

204201
1. Only a small number of computer languages are recognized.
205-
2. Profiles can be accessed via `/?dev=...` links only.
206-
3. The app may include private library names in the report - do not use it on commercially-sensitive projects.
207-
4. The only way to delete a profile is to email [email protected].
208-
5. Your Github profile may already be included in the Directory, but it cannot be linked to your private profile.
209-
6. It may take up to 2 minutes for a profile to be created/updated after a report submission.
210-
7. Very large reports (over 50MB) are likely to be rejected.
202+
2. The app may include private library names in the report - do not use it on commercially-sensitive projects.
203+
3. The only way to delete a profile is to email [email protected].
204+
4. It may take up to 2 minutes for a profile to be created/updated after a report submission.
205+
5. Very large reports (over 50MB) are likely to be rejected.
206+
6. Repositories with more than 10,000 files are not processed.
211207

212208
## Troubleshooting
213209

stackmuncher/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ pub(crate) async fn new_config_with_defaults(current_dir: PathBuf) -> (Config, P
284284
};
285285
let is_local_release = exec_dir.ends_with("target/release") || exec_dir.ends_with("target\\release");
286286

287-
// look for the rules in the current working dir if in debug mode
287+
// use the current working dir if in debug mode
288288
// otherwise default to a platform-specific location
289-
// this can be overridden by `--rules` CLI param
289+
// this can be overridden by `--report` and `--config` CLI param
290290
let (report_dir, config_dir, log_level) = if is_local_release {
291291
// this branch activates when the app is called directly from `stm_app/target/release` folder, but all the config files are 2 levels up
292292
// go 2 steps up in the hierarchy to get to the root of stm_app project

stackmuncher/src/help.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,22 @@ pub(crate) fn emit_gist_instructions(gist_content: &String) {
125125

126126
/// Prints out either Win or nix/Mac Welcome msg.
127127
pub(crate) fn emit_welcome_msg(config: AppConfig) {
128-
let pub_key = ReportSignature::get_public_key(&config.user_key_pair);
128+
// directory profile URL depends on if it's public or not
129+
let dir_profile_url = match &config.gh_login {
130+
Some(login) if !login.is_empty() => format!("https://stackmuncher.com/{}", login),
131+
_ => format!("https://stackmuncher.com/?dev={}", ReportSignature::get_public_key(&config.user_key_pair)),
132+
};
133+
134+
let profile_msg = match &config.gh_login {
135+
Some(login) if !login.is_empty() => String::new(),
136+
_ => format!(
137+
"
138+
An anonymous profile is created in the Directory the first time you run this app.
139+
Run `stackmuncher{exe_suffix} github` to make your profile public with details from your GitHub account.
140+
",
141+
exe_suffix = EXE_SUFFIX
142+
),
143+
};
129144

130145
println!("\
131146
StackMuncher app analyzes your technology stack and showcases it in the Global Directory of Software Developers.
@@ -136,11 +151,8 @@ USAGE:
136151
137152
YOUR DIRECTORY PROFILE:
138153
139-
https://stackmuncher.com/?dev={pub_key}
140-
141-
An anonymous profile is created in the Directory the first time you run this app.
142-
Run `stackmuncher{exe_suffix} github` to make your profile public with details from your GitHub account.
143-
154+
{dir_profile_url}
155+
{profile_msg}
144156
CODE PRIVACY:
145157
All code analysis is done locally. Not a single line of code is leaving your machine. View the source code at https://github.com/stackmuncher.
146158
@@ -151,8 +163,6 @@ OPTIONS:
151163
--gist a URL of your GitHub login validation Gist, run `stackmuncher{exe_suffix} github` for details
152164
153165
--project \"path to project to be analyzed\" can be relative or absolute, defaults to the current working directory
154-
155-
--rules \"path to code analysis rules\" can be relative or absolute, defaults to the application folder
156166
--reports \"path to reports folder\" can be relative or absolute, defaults to the application folder
157167
--config \"path to config folder\" can be relative or absolute, defaults to the application folder
158168
@@ -166,5 +176,5 @@ MORE INFO:
166176
167177
https://stackmuncher.com/about about the Directory
168178
https://github.com/stackmuncher source code, issues and more
169-
",exe_suffix=EXE_SUFFIX, pub_key=pub_key);
179+
",exe_suffix=EXE_SUFFIX, dir_profile_url=dir_profile_url, profile_msg=profile_msg);
170180
}

stackmuncher_lib/src/code_rules.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ pub struct CodeRules {
2727
/// file path, including directories
2828
pub file_ext_regex: Regex,
2929

30-
/// A compiled regex for extracting the file name without path or extension.
31-
/// E.g. `/dir/dir/cs.json` -> `cs`
32-
pub file_name_as_ext_regex: Regex,
33-
3430
/// Contains names of newly added munchers to assist merging multiple instances
3531
/// of CodeRules for parallel processing.
3632
pub new_munchers: Option<HashSet<String>>,
@@ -57,7 +53,6 @@ impl CodeRules {
5753
files_types: BTreeMap::new(),
5854
munchers: BTreeMap::new(),
5955
file_ext_regex: Regex::new("\\.[a-zA-Z0-1_]+$").unwrap(),
60-
file_name_as_ext_regex: Regex::new("[a-zA-Z0-1_]+\\.json$").unwrap(),
6156
new_munchers: None,
6257
};
6358

@@ -99,7 +94,7 @@ impl CodeRules {
9994
// Insert None if the muncher could not be loaded so that it doesn't try to load it again
10095
self.munchers
10196
.insert(muncher_name.clone(), Muncher::new(contents, &muncher_name));
102-
97+
10398
// indicate to the caller that there were new munchers added so they can be shared with other threads
10499
if self.new_munchers.is_none() {
105100
self.new_munchers = Some(HashSet::new());

0 commit comments

Comments
 (0)