Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs indent tests and fixes #1681

Merged
merged 4 commits into from Mar 1, 2018
Merged

Conversation

dgud
Copy link
Contributor

@dgud dgud commented Jan 11, 2018

Move emacs indentation to test suite.

Also fixes a couple of the issues found.

@dgud dgud self-assigned this Jan 11, 2018
@fenollp
Copy link
Contributor

fenollp commented Jan 13, 2018

Hey there, I'm worried that this changes the way some arguments are indented. See here for a diff using your branch's code.
Maybe that's expected and that's fine by me. Just wanted to make sure it was known :)

@dgud
Copy link
Contributor Author

dgud commented Jan 15, 2018

The new looks better than the old so it was intentional :-)
Seriously, I have tried to improve some of the delimiter first cases also 'case' and 'if' should
be better now with a semicolon starting the row.
Thanks for testing.

@deadtrickster
Copy link

While we are on fixes, How hard would be to disable indenting of multi-line string literals?

this:

?assertMatch(<<"# TYPE video_count counter
# HELP video_count number of videos processed processed over time
video_count{ctag=\"value\",type=\"mpeg\"} 2
# TYPE video_sum summary
# HELP video_sum video_size_sum
video_sum_count{sum_tag=\"value\",category=\"category1\",type=\"mpeg\"} 2
video_sum_sum{sum_tag=\"value\",category=\"category1\",type=\"mpeg\"} 5120
# TYPE video_size histogram
# HELP video_size number of videos processed processed over time
video_size_bucket{ctag=\"value\",le=\"0\"} 0
video_size_bucket{ctag=\"value\",le=\"65536\"} 2
video_size_bucket{ctag=\"value\",le=\"4294967296\"} 2
video_size_bucket{ctag=\"value\",le=\"+Inf\"} 2
video_size_count{ctag=\"value\"} 2
video_size_sum{ctag=\"value\"} 5120
# TYPE last_video_size gauge
# HELP last_video_size last processed video size
last_video_size{ctag=\"value\"} 4096

">>, prometheus_text_format:format()).

will be indented to this:

  ?assertMatch(<<"# TYPE video_count counter
# HELP video_count number of videos processed processed over time
                 video_count{ctag=\"value\",type=\"mpeg\"} 2
# TYPE video_sum summary
                             # HELP video_sum video_size_sum
                             video_sum_count{sum_tag=\"value\",category=\"category1\",type=\"mpeg\"} 2
video_sum_sum{sum_tag=\"value\",category=\"category1\",type=\"mpeg\"} 5120
# TYPE video_size histogram
              # HELP video_size number of videos processed processed over time
              video_size_bucket{ctag=\"value\",le=\"0\"} 0
video_size_bucket{ctag=\"value\",le=\"65536\"} 2
video_size_bucket{ctag=\"value\",le=\"4294967296\"} 2
video_size_bucket{ctag=\"value\",le=\"+Inf\"} 2
video_size_count{ctag=\"value\"} 2
video_size_sum{ctag=\"value\"} 5120
# TYPE last_video_size gauge
               # HELP last_video_size last processed video size
               last_video_size{ctag=\"value\"} 4096

">>, prometheus_text_format:format()).

@fenollp
Copy link
Contributor

fenollp commented Feb 19, 2018

@deadtrickster
Copy link

I'm not alone, yay!

dgud added 4 commits March 1, 2018 13:37
Split the manual testcase and run them in daily tests instead.
Easy to run directly as well:
(cd ../test; cerl -eval "emacs_SUITE:indent([])")
Avoid

From:
{
^^element1,
^^element2
}

To:
{
^element1,
^element2
}
@dgud dgud force-pushed the dgud/tools/emacs/indent-tests branch from 83c3ed5 to 13f1dec Compare March 1, 2018 13:54
@dgud dgud merged commit 13f1dec into erlang:maint Mar 1, 2018
@dgud dgud deleted the dgud/tools/emacs/indent-tests branch March 23, 2023 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants