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

Editorial: Fix linter errors in spec #499

Merged
merged 1 commit into from
Sep 9, 2020
Merged

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Sep 3, 2020

Based on a discussion in Temporal, it seems like it might be a good idea to run ecmarkup's linter on the spec, now that in version 4.1.0 has brought several bug fixes in the linter.

This adds the linter to the build process and makes it fail if any warnings are generated.

Copy link
Member

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, few questions. Thanks!

package.json Outdated
@@ -5,15 +5,15 @@
"description": "ECMAScript Internationalization API Specification",
"scripts": {
"build-es2020": "git remote remove origin && git remote add origin \"git@github.com:$TRAVIS_REPO_SLUG.git\" && git fetch --quiet origin && git checkout --quiet es2020 && mkdir \"out/2020\" && cp -R img \"out/2020\" && ecmarkup --verbose spec/index.html out/2020/index.html --css out/2020/ecmarkup.css --js out/2020/ecmarkup.js",
"build-master": "mkdir out && cp -R img out && ecmarkup --verbose spec/index.html out/index.html --css out/ecmarkup.css --js out/ecmarkup.js",
"build-master": "mkdir -p out && cp -R img out && ecmarkup --lint-spec --verbose spec/index.html out/index.html --css out/ecmarkup.css --js out/ecmarkup.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the -p necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had it in a separate commit, but yes it is necessary if you want to run npm run build-master twice in a row.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong feelings about this, but adding -p here will suppress the error that would otherwise abort progress when an "out" directory already exists. The ECMA 262 approach is probably better, but also too complex for my taste.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just a fix for convenience, if it has other disadvantages then I'll go ahead and remove it.

@@ -35,42 +35,42 @@ <h1>Intl[ @@toStringTag ]</h1>
<h1>Constructor Properties of the Intl Object</h1>

<emu-clause id="sec-intl.locale-intro">
<h1>Intl.Locale (...)</h1>
<h1>Intl.Locale ( . . . )</h1>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It in necessary to put the space between the dots too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the ecmarkup linter, yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It brings this spec into alignment with ECMA 262 (example), so I'm in favor.

@@ -251,6 +250,7 @@ <h1>get Intl.Locale.prototype.baseName</h1>
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Let _locale_ be _loc_.[[Locale]].
1. Return the substring of _locale_ corresponding to the `unicode_language_id` production.
</emu-alg>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops.

spec/datetimeformat.html Outdated Show resolved Hide resolved
spec/datetimeformat.html Outdated Show resolved Hide resolved
@@ -35,42 +35,42 @@ <h1>Intl[ @@toStringTag ]</h1>
<h1>Constructor Properties of the Intl Object</h1>

<emu-clause id="sec-intl.locale-intro">
<h1>Intl.Locale (...)</h1>
<h1>Intl.Locale ( . . . )</h1>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It brings this spec into alignment with ECMA 262 (example), so I'm in favor.

spec/negotiation.html Outdated Show resolved Hide resolved
package.json Outdated
@@ -5,15 +5,15 @@
"description": "ECMAScript Internationalization API Specification",
"scripts": {
"build-es2020": "git remote remove origin && git remote add origin \"git@github.com:$TRAVIS_REPO_SLUG.git\" && git fetch --quiet origin && git checkout --quiet es2020 && mkdir \"out/2020\" && cp -R img \"out/2020\" && ecmarkup --verbose spec/index.html out/2020/index.html --css out/2020/ecmarkup.css --js out/2020/ecmarkup.js",
"build-master": "mkdir out && cp -R img out && ecmarkup --verbose spec/index.html out/index.html --css out/ecmarkup.css --js out/ecmarkup.js",
"build-master": "mkdir -p out && cp -R img out && ecmarkup --lint-spec --verbose spec/index.html out/index.html --css out/ecmarkup.css --js out/ecmarkup.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong feelings about this, but adding -p here will suppress the error that would otherwise abort progress when an "out" directory already exists. The ECMA 262 approach is probably better, but also too complex for my taste.

Based on a discussion in Temporal [1], it seems like it might be a good
idea to run ecmarkup's linter on the spec, now that in version 4.1.0 has
brought several bug fixes in the linter.

This adds the linter to the build process, but without making it fail
the build if any warnings are detected, since some of the "errors" are
intentional. (The intentional ones are marked with a comment.)

[1] tc39/proposal-temporal#870
@gibson042 gibson042 merged commit fc3729d into tc39:master Sep 9, 2020
@ptomato ptomato deleted the lint-spec branch September 9, 2020 17:57
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.

3 participants