Skip to content

Commit 678d5e6

Browse files
Merge pull request #95 from SoftwareUnderstanding/copilot/add-gitlab-ci-cd-snippet
docs: exhaustive usage.md — document all CLI flags, config keys, and GitLab CI/CD snippet
2 parents 79d9be3 + 53bb20d commit 678d5e6

2 files changed

Lines changed: 165 additions & 190 deletions

File tree

README.md

Lines changed: 1 addition & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -72,168 +72,7 @@ pip install git+https://github.com/SoftwareUnderstanding/RsMetaCheck.git
7272

7373
## Usage
7474

75-
### GitHub Action
76-
77-
RsMetaCheck can be easily integrated into your CI/CD pipelines as a GitHub Action. We have set it up in GitHub Action in the following repository: [rs-metacheck-action](https://github.com/SoftwareUnderstanding/rs-metacheck-action) and is up in GitHub MarketPlace at [rsmetacheck actions](https://github.com/marketplace/actions/rsmetacheck).
78-
79-
The action will generate `all_pitfalls_results.json`, along with the `pitfalls/` and `somef_outputs/` directories directly in your workflow workspace.
80-
81-
### Run the Detection Tool locally
82-
83-
#### Analyze a Single Repository
84-
85-
```bash
86-
poetry run rsmetacheck --input https://github.com/tidyverse/tidyverse
87-
```
88-
89-
#### Analyze a Specific Branch
90-
91-
You can analyze a specific branch of a repository by using the `--branch` or `-b` flag:
92-
93-
```bash
94-
poetry run rsmetacheck --input https://github.com/tidyverse/tidyverse --branch develop
95-
```
96-
97-
#### Analyze Multiple Repositories from a JSON File
98-
99-
```bash
100-
poetry run rsmetacheck --input repositories.json
101-
```
102-
103-
The `repositories.json` file should be structured as follows:
104-
105-
```json
106-
{
107-
"repositories": [
108-
"https://gitlab.com/example/example_repo_1",
109-
"https://gitlab.com/example/example_repo_2",
110-
"https://github.com/example/example_repo_3"
111-
]
112-
}
113-
```
114-
115-
#### Customize Output Paths
116-
117-
```bash
118-
poetry run rsmetacheck --input repositories.json \
119-
--somef-output ./results/somef \
120-
--pitfalls-output ./results/pitfalls \
121-
--analysis-output ./results/summary.json \
122-
--notes-output ./results/notes.json
123-
```
124-
125-
#### Version Discrepancy Notes
126-
127-
When a metadata version differs from the release version by a small margin (all version components differ by less than 2, e.g., `0.4.3.dev1` vs `0.4.2`), MetaCheck records a **note** rather than a full pitfall. To capture these observations, use the `--notes-output` flag:
128-
129-
```bash
130-
poetry run rsmetacheck --input https://github.com/example/repo --notes-output ./notes.json
131-
```
132-
133-
The notes file is only created when there are observations to report and the `--notes-output` path is specified. Its structure is:
134-
135-
```json
136-
{
137-
"total_notes": 1,
138-
"notes": [
139-
{
140-
"repository": "example/repo",
141-
"file_name": "repo_output.json",
142-
"code": "P001",
143-
"note": "Version discrepancy: metadata '0.4.3.dev1' vs release '0.4.2'"
144-
}
145-
]
146-
}
147-
```
148-
149-
If the version difference is significant (any component differs by 2 or more, e.g., `0.12.4` vs `0.12.1`), it is still flagged as a pitfall.
150-
151-
#### Skip SoMEF and Analyze Existing Outputs
152-
153-
If you've already run SoMEF separately:
154-
155-
```bash
156-
poetry run rsmetacheck --skip-somef --input somef_outputs/*.json
157-
```
158-
159-
Or for multiple paths:
160-
161-
```bash
162-
poetry run rsmetacheck --skip-somef --input my_somef_outputs_1/*.json my_somef_outputs_2/*.json
163-
```
164-
165-
#### Verbose Output for Passed Checks
166-
167-
By default, the JSON-LD files generated by RsMetaCheck will only contain information about pitfalls and warnings that were actually detected. If you want to include all tests in the final JSON-LD, even tests that the repository successfully passed, use the `--verbose` flag:
168-
169-
```bash
170-
poetry run rsmetacheck --input https://github.com/tidyverse/tidyverse --verbose
171-
```
172-
173-
#### Configure Analysis with a Root Config File
174-
175-
You can configure RsMetaCheck with a TOML file at the repository root named `.rsmetacheck.toml` (auto-detected), or pass a custom path with `--config`.
176-
177-
Supported options:
178-
179-
- `ignore`: warnings/pitfalls to ignore (e.g. `P001`, `W002`)
180-
- `exclude_files`: metadata sources to ignore (glob, filename, or substring match)
181-
- `parameters`: per-check parameters for configurable checks
182-
- `profiles`: alternate configurations such as `unstable` or `prerelease`
183-
184-
Example:
185-
186-
```toml
187-
ignore = ["W002"]
188-
exclude_files = ["**/generated/**", "tmp_metadata.json"]
189-
190-
[parameters.P001]
191-
ahead_significant_diff = 2
192-
193-
[parameters.W002]
194-
stale_after_days = 3
195-
196-
[profiles.unstable]
197-
ignore = ["W002", "P017"]
198-
199-
[profiles.unstable.parameters.P001]
200-
ahead_significant_diff = 10
201-
202-
[profiles.prerelease]
203-
ignore = []
204-
205-
[profiles.prerelease.parameters.P001]
206-
ahead_significant_diff = 1
207-
```
208-
209-
Use a specific profile:
210-
211-
```bash
212-
poetry run rsmetacheck --input https://github.com/example/repo --config-profile unstable
213-
```
214-
215-
Use a custom config path:
216-
217-
```bash
218-
poetry run rsmetacheck --input https://github.com/example/repo --config ./ci/rsmetacheck.toml
219-
```
220-
221-
### Output
222-
223-
The tool will:
224-
225-
- Process all JSON files in the SoMEF output directory (by default `somef_outputs` created by the tool)
226-
- Display progress messages showing detected pitfalls
227-
- Generate JSON-LD files of detailed Pitfalls and Warnings detected by the tool in `output_1_pitfalls.jsonld`,
228-
`output_2_pitfalls.jsonld`, etc... in `pitfalls` (by default created by the tool) directory
229-
- Generate a comprehensive report in `all_pitfalls_results.json`
230-
231-
The output file contains:
232-
233-
- EVERSE standardized JSON-LD output of each repository
234-
- Summary statistics of analyzed repositories
235-
- Count and percentage for each pitfall type
236-
- Language-specific breakdown for repositories with target languages
75+
For full usage instructions — including CLI options, GitHub Action integration, GitLab CI/CD setup, output format, and configuration — please refer to the [usage documentation](https://rsmetacheck.readthedocs.io/en/latest/usage/).
23776

23877
## Troubleshooting
23978

0 commit comments

Comments
 (0)