Skip to content

Add linting for shell scripts - #12295

Merged
bors-servo merged 1 commit into
servo:masterfrom
jimberlage:12158/shell-linting
Aug 4, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
jimberlage:12158/shell-linting

Conversation

@jimberlage

@jimberlage jimberlage commented Jul 6, 2016 •

Copy link
Copy Markdown
Contributor

This changes tidy to check shell scripts for the proper shebang and
options. It does not check that variables are formatted correctly. It
also adds a check for the MPL 2.0 license in shell scripts.


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive

highfive commented Jul 6, 2016

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @wafflespeanut: python/tidy/servo_tidy_tests/test_tidy.py, python/tidy/servo_tidy/licenseck.py, python/tidy/servo_tidy/tidy.py, python/tidy/servo_tidy_tests/shell_tidy.sh
  • @aneeshusa: etc/ci/check_no_unwrap.sh, etc/ci/manifest_changed.sh, etc/ci/upload_docs.sh, etc/ci/upload_nightly.sh, etc/ci/lockfile_changed.sh

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 6, 2016
@jimberlage

Copy link
Copy Markdown
Contributor Author

I'd appreciate it if someone took a particularly close look at my changes to components/servo/fake-ld.sh; I don't have the bash expertise to tell if those changes are totally correct.

@jimberlage jimberlage mentioned this pull request Jul 6, 2016
3 of 5 tasks
@jimberlage

Copy link
Copy Markdown
Contributor Author

@Ms2ger could you re-run tests on this? They failed the first time because tidy was changed in between my initial checkout and this PR to test a few more files, and that exposed some out-of-spec shell scripts. That's since been fixed in #12299.

@Ms2ger Ms2ger closed this Jul 10, 2016
@Ms2ger Ms2ger reopened this Jul 10, 2016
@Ms2ger

Ms2ger commented Jul 10, 2016

Copy link
Copy Markdown
Contributor

R? @aneeshusa

@aneeshusa aneeshusa assigned aneeshusa and unassigned Ms2ger Jul 11, 2016
Comment thread components/servo/fake-ld.sh Outdated
TARGET_DIR="${OUT_DIR}/../../.."
arm-linux-androideabi-gcc "$@" \
"${LDFLAGS}" \
-lc \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's put the LDFLAGS, lc and shared flags on the same line since they're all linker arguments.

@aneeshusa aneeshusa added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 18, 2016
jimberlage pushed a commit to jimberlage/servo that referenced this pull request Jul 22, 2016
This makes the changes suggested in servo#12295.  The python code to lint
shell scripts is cleans up generally and some shell scripts are changed
to be more readable.
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Jul 22, 2016
@KiChjang

Copy link
Copy Markdown
Contributor

No merge commits, please. Use rebase instead.

@jimberlage
jimberlage force-pushed the 12158/shell-linting branch from fe73796 to 2206ee6 Compare July 22, 2016 04:00
@jimberlage

Copy link
Copy Markdown
Contributor Author

Cool, I've gone ahead and rebased.

Comment thread etc/ci/upload_docs.sh Outdated
python components/style/properties/build.py servo html

OUT_DIR="`pwd`/target/doc/servo" make -f makefile.cargo -C components/script dom_docs
OUT_DIR="`pwd`/target/doc/servo" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you update this to use $(pwd) per the style guide?

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 8800af2 with merge 7b209e8...

@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 22, 2016
bors-servo pushed a commit that referenced this pull request Jul 22, 2016
Add linting for shell scripts

<!-- Please describe your changes on the following line: -->

This changes tidy to check shell scripts for the proper shebang and
options.  It does not check that variables are formatted correctly.  It
also adds a check for the MPL 2.0 license in shell scripts.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12158 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12295)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - android

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 22, 2016
Comment thread components/servo/fake-ld.sh Outdated

TARGET_DIR="${OUT_DIR}/../../.."
arm-linux-androideabi-gcc "$@" \
"${LDFLAGS}" -lc -shared \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LDFLAGS is not always set, so we need to give it a default value if it isn't. A bash parameter expansion should do the trick.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The default value can just be the empty string.

This changes tidy to check shell scripts for the proper shebang and
options.  It does not check that variables are formatted correctly.  It
also adds a check for the MPL 2.0 license in shell scripts.
@jimberlage
jimberlage force-pushed the 12158/shell-linting branch from 8800af2 to 7952bd0 Compare July 22, 2016 16:53
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 22, 2016
@KiChjang

Copy link
Copy Markdown
Contributor

@bors-servo r=aneeshusa

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 7952bd0 has been approved by aneeshusa

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jul 22, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 7952bd0 with merge a8c41b7...

@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 22, 2016
bors-servo pushed a commit that referenced this pull request Jul 22, 2016
Add linting for shell scripts

<!-- Please describe your changes on the following line: -->

This changes tidy to check shell scripts for the proper shebang and
options.  It does not check that variables are formatted correctly.  It
also adds a check for the MPL 2.0 license in shell scripts.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12158 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12295)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - android

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 22, 2016
@aneeshusa

Copy link
Copy Markdown
Contributor

@bors-servo retry

  • Logs are gone (probably removed by the old-log-cleanup cron job)

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 7952bd0 with merge 4bc629b...

bors-servo pushed a commit that referenced this pull request Aug 4, 2016
Add linting for shell scripts

<!-- Please describe your changes on the following line: -->

This changes tidy to check shell scripts for the proper shebang and
options.  It does not check that variables are formatted correctly.  It
also adds a check for the MPL 2.0 license in shell scripts.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12158 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12295)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Aug 4, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo
bors-servo merged commit 7952bd0 into servo:master Aug 4, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 4, 2016
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.

Add basic linting for etc/ci/ shell scripts

6 participants