html_scss_class_checker 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/changelog-update.yml +62 -0
- data/.github/workflows/gem-push.yml +44 -0
- data/.gitignore +1 -0
- data/.rspec +1 -1
- data/CONTRIBUTING.md +51 -51
- data/Gemfile +17 -3
- data/Gemfile.lock +39 -1
- data/LICENSE +21 -21
- data/README.md +76 -74
- data/Rakefile +44 -12
- data/bin/console +7 -7
- data/bin/setup +22 -22
- data/docs/api.md +97 -0
- data/docs/development.md +87 -87
- data/docs/testing.md +73 -73
- data/docs/usage.md +89 -89
- data/html_scss_class_checker.gemspec +31 -27
- data/lib/html_scss_class_checker/class_checker.rb +33 -33
- data/lib/html_scss_class_checker/class_extractor.rb +14 -14
- data/lib/html_scss_class_checker/file_processor.rb +23 -23
- data/lib/html_scss_class_checker.rb +18 -18
- data/scripts/CreateGemStructure.ps1 +38 -38
- data/scripts/classes +1 -1
- metadata +73 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfb53bca492cc205d1f58e9cb40681e80622a15a2e6837ebc3b204c66743a81d
|
4
|
+
data.tar.gz: f3ec47df796a4b3a81755abdcb94aac6967dc581b7a368bcd9a8cc68858bc477
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 487c05364df94f969d00c204bbda1542ee6945d648d595d7541b772cf1ced1b0bd9e47c7c150c6e51e0499affd7afaa2a304bc514671e108c3ec5d8c348f6495
|
7
|
+
data.tar.gz: de7f1d1bd0b2c278b42a251d8073ca7726dba6b5cd18b305819c21ca21b03ae13325c2a141a37fb8b4bf6b630f430d7ce5b74f222a8404b0315169ef0fd4885a
|
@@ -0,0 +1,62 @@
|
|
1
|
+
name: Update Changelog
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main # Set this to the branch you want to trigger on
|
7
|
+
release:
|
8
|
+
types: [created]
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
update-changelog:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- name: Checkout Repository
|
15
|
+
uses: actions/checkout@v4
|
16
|
+
|
17
|
+
- name: Set up Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: '3.2.2' # Specify your Ruby version
|
21
|
+
|
22
|
+
- name: Install github_changelog_generator
|
23
|
+
run: gem install github_changelog_generator
|
24
|
+
|
25
|
+
- name: Generate Changelog
|
26
|
+
env:
|
27
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
28
|
+
run: |
|
29
|
+
github_changelog_generator \
|
30
|
+
--user visionary-code-works \
|
31
|
+
--project HtmlScssClassChecker \
|
32
|
+
--token ${{ secrets.GITHUB_TOKEN }} \
|
33
|
+
--date-format "%Y-%m-%d" \
|
34
|
+
--output "CHANGELOG.md" \
|
35
|
+
--base "HISTORY.md" \
|
36
|
+
--exclude-labels "duplicate,question,invalid,wontfix,Duplicate,Question,Invalid,Wontfix,Meta: Exclude From Changelog" \
|
37
|
+
--summary-labels "Release summary,release-summary,Summary,summary" \
|
38
|
+
--breaking-labels "backwards-incompatible,Backwards incompatible,breaking" \
|
39
|
+
--enhancement-labels "enhancement,Enhancement,Type: Enhancement" \
|
40
|
+
--bug-labels "bug,Bug,Type: Bug" \
|
41
|
+
--deprecated-labels "deprecated,Deprecated,Type: Deprecated" \
|
42
|
+
--removed-labels "removed,Removed,Type: Removed" \
|
43
|
+
--security-labels "security,Security,Type: Security" \
|
44
|
+
--header "# Changelog" \
|
45
|
+
--merge-prefix "**Merged pull requests:**" \
|
46
|
+
--issue-prefix "**Closed issues:**" \
|
47
|
+
--breaking-prefix "**Breaking changes:**" \
|
48
|
+
--enhancement-prefix "**Implemented enhancements:**" \
|
49
|
+
--bug-prefix "**Fixed bugs:**" \
|
50
|
+
--deprecated-prefix "**Deprecated:**" \
|
51
|
+
--removed-prefix "**Removed:**" \
|
52
|
+
--security-prefix "**Security fixes:**" \
|
53
|
+
--simple-list \
|
54
|
+
--verbose
|
55
|
+
|
56
|
+
- name: Commit and Push Changes
|
57
|
+
run: |
|
58
|
+
git config --local user.email "action@github.com"
|
59
|
+
git config --local user.name "GitHub Action"
|
60
|
+
git add CHANGELOG.md
|
61
|
+
git commit -m "Update CHANGELOG.md"
|
62
|
+
git push
|
@@ -0,0 +1,44 @@
|
|
1
|
+
name: Ruby Gem CI/CD
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "main" ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ "main" ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build-and-publish:
|
11
|
+
name: Build and Publish Gem
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v3
|
16
|
+
|
17
|
+
- name: Set up Ruby 3.2.2
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: '3.2.2'
|
21
|
+
|
22
|
+
- name: Install dependencies
|
23
|
+
run: bundle install
|
24
|
+
|
25
|
+
- name: Build Gem
|
26
|
+
run: gem build *.gemspec
|
27
|
+
|
28
|
+
- name: Push to RubyGems
|
29
|
+
run: |
|
30
|
+
mkdir -p $HOME/.gem
|
31
|
+
touch $HOME/.gem/credentials
|
32
|
+
chmod 0600 $HOME/.gem/credentials
|
33
|
+
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_AUTH_TOKEN}\n" > $HOME/.gem/credentials
|
34
|
+
gem push *.gem
|
35
|
+
env:
|
36
|
+
RUBYGEMS_AUTH_TOKEN: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
37
|
+
|
38
|
+
- name: Tag Incremental Version
|
39
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main')
|
40
|
+
run: |
|
41
|
+
git config --local user.email "action@github.com"
|
42
|
+
git config --local user.name "GitHub Action"
|
43
|
+
git tag -a v$(date +'%Y%m%d%H%M%S') -m "Automated tag from GitHub Actions"
|
44
|
+
git push origin --tags
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--require spec_helper
|
1
|
+
--require spec_helper
|
data/CONTRIBUTING.md
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
# Contributing to HtmlScssClassChecker
|
2
|
-
|
3
|
-
Thank you for your interest in contributing to `HtmlScssClassChecker`! This document provides guidelines for contributions to this project. By contributing to this project, you agree to abide by its terms.
|
4
|
-
|
5
|
-
## Code of Conduct
|
6
|
-
|
7
|
-
Our project adheres to a [Code of Conduct](/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [support@vcwtech.com](mailto:support@vcwtech.com).
|
8
|
-
|
9
|
-
## How to Contribute
|
10
|
-
|
11
|
-
1. **Report Bugs**: If you find a bug, please open an issue in the repository, using the bug report template. Include as much detail as possible, such as steps to reproduce the bug, expected behavior, and actual behavior.
|
12
|
-
|
13
|
-
2. **Suggest Enhancements**: For ideas about new features or improvements, open an issue using the feature request template.
|
14
|
-
|
15
|
-
3. **Submit Pull Requests**: Contributions to the codebase are made through pull requests. Before submitting a pull request, please read and follow the pull request guidelines below.
|
16
|
-
|
17
|
-
## Pull Request Guidelines
|
18
|
-
|
19
|
-
1. **Fork the Repository**: Start by forking the repository and cloning it to your local machine.
|
20
|
-
|
21
|
-
2. **Create a New Branch**: Create a branch for your changes, using a name that reflects the purpose of your contribution, such as `feature/add-new-feature` or `bugfix/fix-some-bug`.
|
22
|
-
|
23
|
-
3. **Make Your Changes**: Implement your changes, adhering to the coding standards and best practices of the project.
|
24
|
-
|
25
|
-
4. **Write Tests**: Add or update tests to cover your changes. Ensure all tests pass.
|
26
|
-
|
27
|
-
5. **Document Your Changes**: Update the README or other documentation as necessary to reflect your changes.
|
28
|
-
|
29
|
-
6. **Commit Your Changes**: Make sure your commit messages are clear and follow best practices.
|
30
|
-
|
31
|
-
7. **Push to Your Fork**: Push your changes to your forked repository.
|
32
|
-
|
33
|
-
8. **Open a Pull Request**: Open a pull request against the main repository. Describe your changes and reference any relevant issues.
|
34
|
-
|
35
|
-
9. **Code Review**: Once your pull request is open, it will be reviewed by maintainers. Engage in the code review process, addressing any feedback.
|
36
|
-
|
37
|
-
## Development Setup
|
38
|
-
|
39
|
-
For instructions on setting up a development environment, please refer to [DEVELOPMENT.md](/DEVELOPMENT.md).
|
40
|
-
|
41
|
-
## Testing
|
42
|
-
|
43
|
-
Before submitting pull requests, ensure that all tests are passing. For information on running and writing tests, see [TESTING.md](/TESTING.md).
|
44
|
-
|
45
|
-
## Questions or Suggestions
|
46
|
-
|
47
|
-
If you have questions or suggestions, feel free to open an issue or reach out to the maintainers at [support@vcwtech.com](mailto:support@vcwtech.com).
|
48
|
-
|
49
|
-
---
|
50
|
-
|
51
|
-
We look forward to your contributions and are excited to see what we can build together in this community!
|
1
|
+
# Contributing to HtmlScssClassChecker
|
2
|
+
|
3
|
+
Thank you for your interest in contributing to `HtmlScssClassChecker`! This document provides guidelines for contributions to this project. By contributing to this project, you agree to abide by its terms.
|
4
|
+
|
5
|
+
## Code of Conduct
|
6
|
+
|
7
|
+
Our project adheres to a [Code of Conduct](/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [support@vcwtech.com](mailto:support@vcwtech.com).
|
8
|
+
|
9
|
+
## How to Contribute
|
10
|
+
|
11
|
+
1. **Report Bugs**: If you find a bug, please open an issue in the repository, using the bug report template. Include as much detail as possible, such as steps to reproduce the bug, expected behavior, and actual behavior.
|
12
|
+
|
13
|
+
2. **Suggest Enhancements**: For ideas about new features or improvements, open an issue using the feature request template.
|
14
|
+
|
15
|
+
3. **Submit Pull Requests**: Contributions to the codebase are made through pull requests. Before submitting a pull request, please read and follow the pull request guidelines below.
|
16
|
+
|
17
|
+
## Pull Request Guidelines
|
18
|
+
|
19
|
+
1. **Fork the Repository**: Start by forking the repository and cloning it to your local machine.
|
20
|
+
|
21
|
+
2. **Create a New Branch**: Create a branch for your changes, using a name that reflects the purpose of your contribution, such as `feature/add-new-feature` or `bugfix/fix-some-bug`.
|
22
|
+
|
23
|
+
3. **Make Your Changes**: Implement your changes, adhering to the coding standards and best practices of the project.
|
24
|
+
|
25
|
+
4. **Write Tests**: Add or update tests to cover your changes. Ensure all tests pass.
|
26
|
+
|
27
|
+
5. **Document Your Changes**: Update the README or other documentation as necessary to reflect your changes.
|
28
|
+
|
29
|
+
6. **Commit Your Changes**: Make sure your commit messages are clear and follow best practices.
|
30
|
+
|
31
|
+
7. **Push to Your Fork**: Push your changes to your forked repository.
|
32
|
+
|
33
|
+
8. **Open a Pull Request**: Open a pull request against the main repository. Describe your changes and reference any relevant issues.
|
34
|
+
|
35
|
+
9. **Code Review**: Once your pull request is open, it will be reviewed by maintainers. Engage in the code review process, addressing any feedback.
|
36
|
+
|
37
|
+
## Development Setup
|
38
|
+
|
39
|
+
For instructions on setting up a development environment, please refer to [DEVELOPMENT.md](/DEVELOPMENT.md).
|
40
|
+
|
41
|
+
## Testing
|
42
|
+
|
43
|
+
Before submitting pull requests, ensure that all tests are passing. For information on running and writing tests, see [TESTING.md](/TESTING.md).
|
44
|
+
|
45
|
+
## Questions or Suggestions
|
46
|
+
|
47
|
+
If you have questions or suggestions, feel free to open an issue or reach out to the maintainers at [support@vcwtech.com](mailto:support@vcwtech.com).
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
We look forward to your contributions and are excited to see what we can build together in this community!
|
data/Gemfile
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
group :development, :test do
|
4
|
+
# Gems used for both development and testing
|
5
|
+
gem 'rspec'
|
6
|
+
|
7
|
+
# Test coverage tool
|
8
|
+
gem 'simplecov', require: false
|
9
|
+
end
|
10
|
+
|
11
|
+
group :development do
|
12
|
+
# Ruby code linter
|
13
|
+
gem 'rubocop', require: false
|
14
|
+
|
15
|
+
# Documentation generator
|
16
|
+
gem 'yard', require: false
|
17
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
GEM
|
2
|
+
remote: https://rubygems.org/
|
2
3
|
specs:
|
4
|
+
ast (2.4.2)
|
3
5
|
diff-lcs (1.5.0)
|
6
|
+
docile (1.4.0)
|
7
|
+
json (2.7.1)
|
8
|
+
language_server-protocol (3.17.0.3)
|
9
|
+
parallel (1.24.0)
|
10
|
+
parser (3.2.2.4)
|
11
|
+
ast (~> 2.4.1)
|
12
|
+
racc
|
13
|
+
racc (1.7.3)
|
14
|
+
rainbow (3.1.1)
|
15
|
+
regexp_parser (2.8.3)
|
16
|
+
rexml (3.2.6)
|
4
17
|
rspec (3.12.0)
|
5
18
|
rspec-core (~> 3.12.0)
|
6
19
|
rspec-expectations (~> 3.12.0)
|
@@ -14,12 +27,37 @@ GEM
|
|
14
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
15
28
|
rspec-support (~> 3.12.0)
|
16
29
|
rspec-support (3.12.1)
|
30
|
+
rubocop (1.59.0)
|
31
|
+
json (~> 2.3)
|
32
|
+
language_server-protocol (>= 3.17.0)
|
33
|
+
parallel (~> 1.10)
|
34
|
+
parser (>= 3.2.2.4)
|
35
|
+
rainbow (>= 2.2.2, < 4.0)
|
36
|
+
regexp_parser (>= 1.8, < 3.0)
|
37
|
+
rexml (>= 3.2.5, < 4.0)
|
38
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
39
|
+
ruby-progressbar (~> 1.7)
|
40
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
41
|
+
rubocop-ast (1.30.0)
|
42
|
+
parser (>= 3.2.1.0)
|
43
|
+
ruby-progressbar (1.13.0)
|
44
|
+
simplecov (0.22.0)
|
45
|
+
docile (~> 1.1)
|
46
|
+
simplecov-html (~> 0.11)
|
47
|
+
simplecov_json_formatter (~> 0.1)
|
48
|
+
simplecov-html (0.12.3)
|
49
|
+
simplecov_json_formatter (0.1.4)
|
50
|
+
unicode-display_width (2.5.0)
|
51
|
+
yard (0.9.34)
|
17
52
|
|
18
53
|
PLATFORMS
|
19
|
-
|
54
|
+
x86_64-linux
|
20
55
|
|
21
56
|
DEPENDENCIES
|
22
57
|
rspec
|
58
|
+
rubocop
|
59
|
+
simplecov
|
60
|
+
yard
|
23
61
|
|
24
62
|
BUNDLED WITH
|
25
63
|
2.4.22
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2023 Visionary Code Works
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 Visionary Code Works
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,74 +1,76 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
```
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
```
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
```
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
"
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
- [
|
72
|
-
- [
|
73
|
-
- [
|
74
|
-
- [
|
1
|
+
# Html Scss Class Checker
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/html_scss_class_checker.svg)](https://badge.fury.io/rb/html_scss_class_checker)
|
4
|
+
|
5
|
+
HtmlScssClassChecker is a Ruby gem for extracting and comparing class names from HTML and SCSS files. It helps in identifying unmatched or unused classes, enhancing the maintainability of front-end codebases.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'html_scss_class_checker'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
bundle install
|
19
|
+
```
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
gem install html_scss_class_checker
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
To use HtmlScssClassChecker, you need to set up a configuration JSON file (`config.json`) specifying known classes and directories to be checked:
|
30
|
+
|
31
|
+
```json
|
32
|
+
{
|
33
|
+
"known_classes": ["class1", "class2"],
|
34
|
+
"html_directories": ["_includes", "_layouts"],
|
35
|
+
"scss_directories": ["_sass"]
|
36
|
+
}
|
37
|
+
```
|
38
|
+
|
39
|
+
Run the checker with:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'html_scss_class_checker'
|
43
|
+
|
44
|
+
checker = HtmlScssClassChecker::ClassChecker.new(config)
|
45
|
+
checker.check
|
46
|
+
|
47
|
+
puts "Unmatched Classes:"
|
48
|
+
puts checker.unmatched_classes.to_a
|
49
|
+
```
|
50
|
+
|
51
|
+
More detailed usage instructions will be provided in the [Usage Documentation](/docs/usage.md).
|
52
|
+
|
53
|
+
## Contributing
|
54
|
+
|
55
|
+
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change. Please ensure to update tests as appropriate.
|
56
|
+
|
57
|
+
See [CONTRIBUTING.md](/CONTRIBUTING.md) for detailed guidelines.
|
58
|
+
|
59
|
+
## Documentation
|
60
|
+
|
61
|
+
For full documentation, visit [our documentation page](/docs).
|
62
|
+
|
63
|
+
## License
|
64
|
+
|
65
|
+
Distributed under the MIT License. See [LICENSE](/LICENSE) for more information.
|
66
|
+
|
67
|
+
## Additional Resources
|
68
|
+
|
69
|
+
[![Update Changelog](https://github.com/Visionary-Code-Works/HtmlScssClassChecker/actions/workflows/changelog-update.yml/badge.svg)](https://github.com/Visionary-Code-Works/HtmlScssClassChecker/actions/workflows/changelog-update.yml)
|
70
|
+
|
71
|
+
- [Changelog](/CHANGELOG.md): Detailed list of changes in each version.
|
72
|
+
- [Code of Conduct](/CODE_OF_CONDUCT.md): Guidelines for participation in the community.
|
73
|
+
- [Development Guide](/docs/development.md): Instructions for setting up a development environment and working on the gem.
|
74
|
+
- [Testing Guide](/docs/testing.md): Information on how to run and write tests for the gem.
|
75
|
+
- [Usage Documentation](/docs/usage.md): Provide detailed instructions on how to use the gem, including various configurations and options.
|
76
|
+
- [Contributing Guidelines](/CONTRIBUTING.md): Outline how others can contribute to your project. Include information on coding standards, pull request processes, and issue reporting guidelines.
|
data/Rakefile
CHANGED
@@ -1,12 +1,44 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rake/testtask"
|
3
|
-
|
4
|
-
|
5
|
-
Rake
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
#
|
12
|
-
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
|
+
require 'simplecov' # Add SimpleCov for test coverage
|
4
|
+
|
5
|
+
# Rake task for building the gem.
|
6
|
+
# This task uses Bundler to build the gem based on the specifications
|
7
|
+
# defined in your gemspec file.
|
8
|
+
require "bundler/gem_tasks"
|
9
|
+
|
10
|
+
# Define a task for running tests using RSpec.
|
11
|
+
# This sets up RSpec to run all spec files located in the 'spec' directory.
|
12
|
+
Rake::TestTask.new(:spec) do |t|
|
13
|
+
t.libs.push "spec"
|
14
|
+
t.ruby_opts = ["-W0"] # Suppresses Ruby warnings
|
15
|
+
t.pattern = "spec/**/*_spec.rb" # Location of spec files
|
16
|
+
|
17
|
+
# SimpleCov start must be at the very top to capture all files
|
18
|
+
SimpleCov.start do
|
19
|
+
add_filter '/spec/' # Exclude spec directory from coverage
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Task for running RuboCop for code linting
|
24
|
+
desc "Run RuboCop on the lib and spec directories"
|
25
|
+
task :rubocop do
|
26
|
+
sh "rubocop lib spec"
|
27
|
+
end
|
28
|
+
|
29
|
+
# Task for generating documentation using YARD or another documentation tool
|
30
|
+
desc "Generate documentation"
|
31
|
+
task :document do
|
32
|
+
sh "yard doc" # or replace with your preferred documentation tool
|
33
|
+
end
|
34
|
+
|
35
|
+
# Set the default task for Rake.
|
36
|
+
# When running 'rake' without arguments, it will run the 'spec' task.
|
37
|
+
task default: :spec
|
38
|
+
|
39
|
+
# Add a task for checking test coverage after running tests
|
40
|
+
desc "Run specs with coverage"
|
41
|
+
task :coverage do
|
42
|
+
ENV['COVERAGE'] = 'true'
|
43
|
+
Rake::Task["spec"].invoke
|
44
|
+
end
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'irb'
|
4
|
-
require 'html_scss_class_checker' # Require your gem
|
5
|
-
|
6
|
-
# Start an IRB session with your gem loaded
|
7
|
-
IRB.start
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'irb'
|
4
|
+
require 'html_scss_class_checker' # Require your gem
|
5
|
+
|
6
|
+
# Start an IRB session with your gem loaded
|
7
|
+
IRB.start
|
data/bin/setup
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fileutils'
|
4
|
-
require 'json'
|
5
|
-
|
6
|
-
# Example setup tasks
|
7
|
-
puts "Setting up the HtmlScssClassChecker gem..."
|
8
|
-
|
9
|
-
# Create a default configuration file if it doesn't exist
|
10
|
-
config_path = File.join(Dir.pwd, 'config.json')
|
11
|
-
unless File.exist?(config_path)
|
12
|
-
default_config = {
|
13
|
-
'known_classes' => [],
|
14
|
-
'html_directories' => ['_includes', '_layouts'],
|
15
|
-
'scss_directories' => ['_sass']
|
16
|
-
}
|
17
|
-
|
18
|
-
File.write(config_path, JSON.pretty_generate(default_config))
|
19
|
-
puts "Created default config.json file."
|
20
|
-
end
|
21
|
-
|
22
|
-
puts "Setup complete."
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
# Example setup tasks
|
7
|
+
puts "Setting up the HtmlScssClassChecker gem..."
|
8
|
+
|
9
|
+
# Create a default configuration file if it doesn't exist
|
10
|
+
config_path = File.join(Dir.pwd, 'config.json')
|
11
|
+
unless File.exist?(config_path)
|
12
|
+
default_config = {
|
13
|
+
'known_classes' => [],
|
14
|
+
'html_directories' => ['_includes', '_layouts'],
|
15
|
+
'scss_directories' => ['_sass']
|
16
|
+
}
|
17
|
+
|
18
|
+
File.write(config_path, JSON.pretty_generate(default_config))
|
19
|
+
puts "Created default config.json file."
|
20
|
+
end
|
21
|
+
|
22
|
+
puts "Setup complete."
|