Skip to content

Commit d5e221c

Browse files
authored
docs: replace README Usage section with link to usage documentation
1 parent 82820f3 commit d5e221c

1 file changed

Lines changed: 1 addition & 185 deletions

File tree

README.md

Lines changed: 1 addition & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -72,191 +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-
### GitLab CI/CD
82-
83-
Add the following snippet to your `.gitlab-ci.yml` to run RSMetaCheck on your GitLab repository:
84-
85-
```yaml
86-
rsmetacheck:
87-
image: python:3.11
88-
stage: test
89-
script:
90-
- pip install rsmetacheck
91-
- somef configure -a
92-
- rsmetacheck --input $CI_PROJECT_URL
93-
artifacts:
94-
paths:
95-
- pitfalls_outputs/
96-
- somef_outputs/
97-
- analysis_results.json
98-
when: always
99-
expire_in: 1 week
100-
```
101-
102-
`$CI_PROJECT_URL` is a built-in GitLab CI/CD variable that automatically resolves to your repository's URL. To avoid GitHub API rate limits when SoMEF fetches metadata, store your GitHub personal access token as a GitLab CI/CD variable named `GITHUB_TOKEN` and pass it via `somef configure -a -t $GITHUB_TOKEN`.
103-
104-
### Run the Detection Tool locally
105-
106-
#### Analyze a Single Repository
107-
108-
```bash
109-
poetry run rsmetacheck --input https://github.com/tidyverse/tidyverse
110-
```
111-
112-
#### Analyze a Specific Branch
113-
114-
You can analyze a specific branch of a repository by using the `--branch` or `-b` flag:
115-
116-
```bash
117-
poetry run rsmetacheck --input https://github.com/tidyverse/tidyverse --branch develop
118-
```
119-
120-
#### Analyze Multiple Repositories from a JSON File
121-
122-
```bash
123-
poetry run rsmetacheck --input repositories.json
124-
```
125-
126-
The `repositories.json` file should be structured as follows:
127-
128-
```json
129-
{
130-
"repositories": [
131-
"https://gitlab.com/example/example_repo_1",
132-
"https://gitlab.com/example/example_repo_2",
133-
"https://github.com/example/example_repo_3"
134-
]
135-
}
136-
```
137-
138-
#### Customize Output Paths
139-
140-
```bash
141-
poetry run rsmetacheck --input repositories.json \
142-
--somef-output ./results/somef \
143-
--pitfalls-output ./results/pitfalls \
144-
--analysis-output ./results/summary.json \
145-
--notes-output ./results/notes.json
146-
```
147-
148-
#### Version Discrepancy Notes
149-
150-
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:
151-
152-
```bash
153-
poetry run rsmetacheck --input https://github.com/example/repo --notes-output ./notes.json
154-
```
155-
156-
The notes file is only created when there are observations to report and the `--notes-output` path is specified. Its structure is:
157-
158-
```json
159-
{
160-
"total_notes": 1,
161-
"notes": [
162-
{
163-
"repository": "example/repo",
164-
"file_name": "repo_output.json",
165-
"code": "P001",
166-
"note": "Version discrepancy: metadata '0.4.3.dev1' vs release '0.4.2'"
167-
}
168-
]
169-
}
170-
```
171-
172-
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.
173-
174-
#### Skip SoMEF and Analyze Existing Outputs
175-
176-
If you've already run SoMEF separately:
177-
178-
```bash
179-
poetry run rsmetacheck --skip-somef --input somef_outputs/*.json
180-
```
181-
182-
Or for multiple paths:
183-
184-
```bash
185-
poetry run rsmetacheck --skip-somef --input my_somef_outputs_1/*.json my_somef_outputs_2/*.json
186-
```
187-
188-
#### Verbose Output for Passed Checks
189-
190-
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:
191-
192-
```bash
193-
poetry run rsmetacheck --input https://github.com/tidyverse/tidyverse --verbose
194-
```
195-
196-
#### Configure Analysis with a Root Config File
197-
198-
You can configure RsMetaCheck with a TOML file at the repository root named `.rsmetacheck.toml` (auto-detected), or pass a custom path with `--config`.
199-
200-
Supported options:
201-
202-
- `ignore`: warnings/pitfalls to ignore (e.g. `P001`, `W002`)
203-
- `exclude_files`: metadata sources to ignore (glob, filename, or substring match)
204-
- `parameters`: per-check parameters for configurable checks
205-
- `profiles`: alternate configurations such as `unstable` or `prerelease`
206-
207-
Example:
208-
209-
```toml
210-
ignore = ["W002"]
211-
exclude_files = ["**/generated/**", "tmp_metadata.json"]
212-
213-
[parameters.P001]
214-
ahead_significant_diff = 2
215-
216-
[parameters.W002]
217-
stale_after_days = 3
218-
219-
[profiles.unstable]
220-
ignore = ["W002", "P017"]
221-
222-
[profiles.unstable.parameters.P001]
223-
ahead_significant_diff = 10
224-
225-
[profiles.prerelease]
226-
ignore = []
227-
228-
[profiles.prerelease.parameters.P001]
229-
ahead_significant_diff = 1
230-
```
231-
232-
Use a specific profile:
233-
234-
```bash
235-
poetry run rsmetacheck --input https://github.com/example/repo --config-profile unstable
236-
```
237-
238-
Use a custom config path:
239-
240-
```bash
241-
poetry run rsmetacheck --input https://github.com/example/repo --config ./ci/rsmetacheck.toml
242-
```
243-
244-
### Output
245-
246-
The tool will:
247-
248-
- Process all JSON files in the SoMEF output directory (by default `somef_outputs` created by the tool)
249-
- Display progress messages showing detected pitfalls
250-
- Generate JSON-LD files of detailed Pitfalls and Warnings detected by the tool in `output_1_pitfalls.jsonld`,
251-
`output_2_pitfalls.jsonld`, etc... in `pitfalls` (by default created by the tool) directory
252-
- Generate a comprehensive report in `all_pitfalls_results.json`
253-
254-
The output file contains:
255-
256-
- EVERSE standardized JSON-LD output of each repository
257-
- Summary statistics of analyzed repositories
258-
- Count and percentage for each pitfall type
259-
- 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/).
26076

26177
## Troubleshooting
26278

0 commit comments

Comments
 (0)