Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tag release#52

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
74 commits
Select commitHold shift + click to select a range
419727a
ERB: Managed to format first example
davidwessmanMay 14, 2023
2cc26ac
Format all ruby files
davidwessmanMay 14, 2023
45d7f45
First implementation of blocks
davidwessmanMay 18, 2023
0877f91
Merge pull request #1 from davidwessman/blocks
davidwessmanMay 18, 2023
a51e673
Handles basic vue-components (#2)
davidwessmanMay 19, 2023
4deaeb1
Changes register_handler
davidwessmanMay 19, 2023
7320b93
Handles empty and invalid files (#3)
davidwessmanMay 19, 2023
c87ffc4
Handles attribute names like vue events `@click` (#4)
davidwessmanMay 19, 2023
e2f8307
Adds ErbUnless to handle `unless` syntax (#5)
davidwessmanMay 20, 2023
c26791e
Handles more formats for ERB syntax (#6)
davidwessmanMay 20, 2023
6d31d98
Keep blank lines (#7)
davidwessmanMay 20, 2023
d56cf87
Support full layouts and doctype (#8)
davidwessmanMay 20, 2023
995ed0f
Changes error handling (#9)
davidwessmanMay 21, 2023
ac9b4d3
Handles edge cases where blocks failed to parse (#10)
davidwessmanMay 21, 2023
e4d42a1
Adds test for parsing unmatched quotes (#11)
davidwessmanMay 21, 2023
23a3056
Doctype: Handles casing (#12)
davidwessmanMay 21, 2023
b8e0e0c
ERB: Consider newlines before parsing the code (#13)
davidwessmanMay 21, 2023
10c73d0
Handles HTML-comments (#14)
davidwessmanMay 21, 2023
dc3ab8d
Handles non-ascii ERB-code (#15)
davidwessmanMay 25, 2023
df4acbf
Support quotes in HTML-text (#16)
davidwessmanMay 26, 2023
526b80a
Allow html attribute to start with @:# (#17)
davidwessmanMay 26, 2023
1894714
Handles dot, dash and underscore in attribute names (#18)
davidwessmanMay 26, 2023
ad3647e
HTML: Handles attribute values without quotes (#19)
davidwessmanMay 26, 2023
412b54f
Adds script for parsing all .html.erb and output (#20)
davidwessmanMay 28, 2023
357e8e5
Failing to format long if-statements multiple times (#21)
davidwessmanMay 28, 2023
b366e80
Changed how blocks are formatted (#22)
davidwessmanMay 28, 2023
9c929ab
Changes print width if erb tag has IfNode (#23)
davidwessmanMay 28, 2023
3be3202
Fixes handling of comments in ERB (#24)
davidwessmanJun 1, 2023
12b5e01
Handles formatting of IfOp (#25)
davidwessmanJun 3, 2023
f310a7b
Updates README (#26)
davidwessmanJun 4, 2023
743db1e
Update issue templates (#27)
davidwessmanJun 4, 2023
4cad3d7
Updates README and gemspec (#29)
davidwessmanJun 4, 2023
b18b871
Update issue templates
davidwessmanJun 4, 2023
8028145
Handles Alpine.js syntax (#31)
davidwessmanJun 6, 2023
b67eb2b
Github Actions: Adds ruby matrix (#33)
davidwessmanJun 18, 2023
15b11a5
Adds support for case-when-statements (#32)
davidwessmanJun 18, 2023
927f3c4
Github Actions: Fixes triggers (#34)
davidwessmanJun 18, 2023
1c2f658
Handles ternaries as arguments (#36)
davidwessmanJun 22, 2023
36da1d2
Bump minitest from 5.18.0 to 5.18.1 (#35)
dependabot[bot]Jun 22, 2023
582e694
Setup gem and tag v0.9.0 (#37)
davidwessmanJun 22, 2023
8b5aca9
Handles ERB-tags with multiple statements (#38)
davidwessmanJun 28, 2023
b43c4d6
v0.9.1 (#39)
davidwessmanJun 28, 2023
7a4c3bd
Handle whitespace in HTML-strings with ERB (#40)
davidwessmanJun 30, 2023
3dbc3d9
v0.9.2 2023-06-30 (#41)
davidwessmanJun 30, 2023
98227e3
Format empty html-tags on one line if possible (#42)
davidwessmanJun 30, 2023
bf18cbe
0.9.4: Format empty HTML-tags as a group (#43)
davidwessmanJul 1, 2023
aa97395
Fixes bundle warnings (#44)
davidwessmanJul 2, 2023
f89f7a0
v0.9.5 - Fixes formatting of ruby comment in ERB-tag (#45)
davidwessmanJul 2, 2023
bec4339
Adds pre-commit hooks using Husky (#46)
davidwessmanJul 2, 2023
20e4ec4
Removes unused breakable(force: true) (#49)
davidwessmanJul 21, 2023
4ac2a14
Adds handler for .html.erb (#52)
davidwessmanAug 12, 2023
71f6d23
Bump minitest from 5.18.1 to 5.19.0 (#50)
dependabot[bot]Aug 12, 2023
c311c54
Refactor line breaks and whitespace (#51)
davidwessmanAug 19, 2023
0a513a5
Tests: Refactors test cases and namings (#53)
davidwessmanAug 20, 2023
7679304
Handles self-closing new lines (#54)
davidwessmanAug 20, 2023
375d720
Release v0.10.0 (#55)
davidwessmanAug 20, 2023
cf23af0
Handles doctype more freely (#56)
davidwessmanAug 20, 2023
0cd3195
Handles empty documents and leading new lines (#57)
davidwessmanAug 22, 2023
67cc3e9
Handles trailing whitespace in char data (#58)
davidwessmanAug 22, 2023
f24718a
Release v0.10.2 (#59)
davidwessmanAug 22, 2023
f8559fe
Supports ERB-tags with if-else-end in same tag (#61)
davidwessmanAug 27, 2023
605300d
Avoid grouping single ERB-tags and handle ERB-comments with newlines …
davidwessmanAug 27, 2023
d2b7eea
Release v0.10.4 (#63)
davidwessmanAug 28, 2023
56470a8
Handles ERB-tag inside HTML tags (#64)
davidwessmanAug 30, 2023
c2f2a05
Handles indentation for multiline ERB-comments (#65)
davidwessmanAug 30, 2023
bad2142
Handle do-arguments in ERB-tags and release 0.10.5 (#67)
davidwessmanSep 3, 2023
9e55b88
Update formatting-report.md
davidwessmanSep 3, 2023
a348c86
ErbContent: Adds value to elements (#69)
davidwessmanSep 18, 2023
e386ec5
Bump minitest from 5.19.0 to 5.20.0 (#68)
dependabot[bot]Sep 18, 2023
f2269fd
Removes auto-merge workflow (#70)
davidwessmanSep 18, 2023
9ad25b5
Bump syntax_tree from 6.1.1 to 6.2.0 (#71)
dependabot[bot]Apr 23, 2024
f0e51e5
Bump rake from 13.0.6 to 13.1.0 (#72)
dependabot[bot]Apr 23, 2024
b91d2b8
Allow html void tags (#73)
rdimartinoApr 23, 2024
edc8267
Release v0.11.0
davidwessmanApr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions.github/ISSUE_TEMPLATE/formatting-report.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
---
name: Formatting report
about: Create a report to help us improve
title: "[Formatting] "
labels: bug
assignees: davidwessman

---

<details>
<summary>ERB-snippet</summary>

```html
<% code %>
```
</details>

<details>
<summary>Expected formatting</summary>

```html
<% code %>
```
</details>
<details>
<summary>Actual formatting</summary>

```html
<% code %>
```
</details>

## Comment

## Versions
syntax_tree:
syntax_tree-erb:
10 changes: 10 additions & 0 deletions.github/ISSUE_TEMPLATE/general.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
name: General
about: General issues
title: ''
labels: ''
assignees: ''

---


22 changes: 0 additions & 22 deletions.github/workflows/auto-merge.yml
View file
Open in desktop

This file was deleted.

35 changes: 24 additions & 11 deletions.github/workflows/main.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
name: Main
on:
- push
- pull_request_target
workflow_dispatch:
push:
branches:
- main

pull_request:
types: [opened, synchronize, reopened]
jobs:
ci:
strategy:
fail-fast: false
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
name: CI
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@master
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version:'3.1'
- name: Test
run: |
bundle exec rake test
bundle exec rake stree:check
- uses: actions/checkout@master
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version:${{ matrix.ruby }}
- name: Test
run: |
bundle exec rake test
bundle exec rake stree:check
2 changes: 1 addition & 1 deletion.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,4 +7,4 @@
/spec/reports/
/tmp/

test.xml
test.erb
4 changes: 4 additions & 0 deletions.husky/pre-commit
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
."$(dirname --"$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions.tool-versions
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
ruby 3.2.3
25 changes: 25 additions & 0 deletions.vscode/launch.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "ruby_lsp",
"name": "Debug file",
"request": "launch",
"program": "ruby ${file}"
},
{
"type": "ruby_lsp",
"name": "Debug test",
"request": "launch",
"program": "ruby -Itest ${relativeFile}"
},
{
"type": "ruby_lsp",
"name": "Debug attach",
"request": "attach"
}
]
}
121 changes: 117 additions & 4 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,11 +6,124 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [Unreleased]

## [0.1.0] - 2022-05-25
## [0.11.0] - 2024-04-23

- ErbContent now has its value as child_nodes instead of empty array.
- Allow html void tags and format self-closing tags

## [0.10.5] - 2023-09-03

- Handle ERB-tags inside HTML-tags, like `<div <%= "class='foo'" %>>`
- Handles indentation for multiline ERB-comment
- Handles spaces between do-arguments and ERB-tags

## [0.10.4] - 2023-08-28

- Avoid grouping single tags
- Handle multiline ERB-comments

## [0.10.3] - 2023-08-27

## Fixes

- Allows parsing ERB-tags with if, else and end in the same tag

```erb
<%= if true
what
end %>
```

This opens the possibility for formatting all if-statements with SyntaxTree properly
and removes the fix where any if-statement was force to one line.

## [0.10.2] - 2023-08-22

### Fixes

- Handles formatting empty documents and removing leading new-linews in files with content.
- Removes trailing whitespace from char data if it is the last element in a document, block or group.

## [0.10.1] - 2023-08-20

### Added

- Allow `DOCTYPE` to be after other tags, to work with e.g. ERB-tags on first line.

## [0.10.0] - 2023-08-20

- Changes how whitespace and newlines are handled.
- Supports syntax like:

```erb
<%= part %> / <%= total %> (<%= percentage %>%)
```

## [0.9.5] - 2023-07-02

- Fixes ruby comment in ERB-tag included VoidStatement
Example:

```erb
<% # this is a comment %>
```

Output:

```diff
-<%
-
- # this is a comment
-%>
+<% # this is a comment %>
```

- Updates versions in Bundler

## [0.9.4] - 2023-07-01

- Inline even more empty HTML-tags

```diff
<three-word-component
:attribute1
:attribute2
:attribute3="value"
->
-</three-word-component>
+></three-word-component>
```

## [0.9.3] - 2023-06-30

- Print empty html-tags on one line if possible

## [0.9.2] - 2023-06-30

- Handle whitespace in HTML-strings using ERB-tags

## [0.9.1] - 2023-06-28

- Handle formatting of multi-line ERB-tags with more than one statement.

## [0.9.0] - 2023-06-22

### Added

- 🎉 Initial release! 🎉
- 🎉 First version based on syntax_tree-xml 🎉.
- Can format a lot of .html.erb-syntax and works as a plugin to syntax_tree.
- This is still early and there are a lot of different weird syntaxes out there.

[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree-xml/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/ruby-syntax-tree/syntax_tree-xml/compare/c34baa...v0.1.0
[unreleased]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.5...HEAD
[0.10.5]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.4...v0.10.5
[0.10.4]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.3...v0.10.4
[0.10.3]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.2...v0.10.3
[0.10.2]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.1...v0.10.2
[0.10.1]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.0...v0.10.1
[0.10.0]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.9.5...v0.10.0
[0.9.5]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.9.4...v0.9.5
[0.9.4]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.9.3...v0.9.4
[0.9.3]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/davidwessman/syntax_tree-erb/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/davidwessman/syntax_tree-erb/compare/419727a73af94057ca0980733e69ac8b4d52fdf4...v0.9.0
26 changes: 14 additions & 12 deletionsGemfile.lock
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
PATH
remote: .
specs:
syntax_tree-xml (0.1.0)
prettier_print (>= 1.0.2)
syntax_tree (>= 4.0.1)
w_syntax_tree-erb (0.11.0)
prettier_print (~> 1.2, >= 1.2.0)
syntax_tree (~> 6.1, >= 6.1.1)

GEM
remote: https://rubygems.org/
specs:
docile (1.4.0)
minitest (5.18.0)
minitest (5.20.0)
prettier_print (1.2.1)
rake (13.0.6)
rake (13.1.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
syntax_tree (6.1.1)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)

PLATFORMS
arm64-darwin-21
arm64-darwin-23
x86_64-darwin-21
x86_64-darwin-22
x86_64-linux

DEPENDENCIES
bundler
minitest
rake
simplecov
syntax_tree-xml!
bundler (~> 2)
minitest (~> 5)
rake (~> 13)
simplecov (~> 0.22)
w_syntax_tree-erb!

BUNDLED WITH
2.3.6
2.4.1
Loading

[8]ページ先頭

©2009-2025 Movatter.jp