-
Notifications
You must be signed in to change notification settings - Fork 454
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
Terraform support #1882
Terraform support #1882
Conversation
Travis failed because:
Have I to fix something or is this a pipeline thing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! Some small changes. We also need to see new examples for this language and ensure Travis CI and AppVeyor are passing. Thanks!
CHANGELOG.md
Outdated
@@ -1,4 +1,5 @@ | |||
# Next | |||
- See [](). Add support for Terraform fmt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the link:
See [#645](https://github.com/Glavin001/atom-beautify/issues/645). Add support for Terraform fmt.
src/beautifiers/terraformfmt.coffee
Outdated
module.exports = class Terraformfmt extends Beautifier | ||
name: "terraformfmt" | ||
link: "https://www.terraform.io/docs/commands/fmt.html" | ||
isPreInstalled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New beautifiers should use executables
feature: #1687
Here's one Pull Request for example: https://github.com/Glavin001/atom-beautify/pull/1726/files#diff-4bf70ccc1cd2e9c4d2706b85b61fb41c
Please let me know if you have any questions. The Executables feature needs more documentation, so currently all we have are existing beautifiers are examples. See https://github.com/Glavin001/atom-beautify#beautifiers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I change this, the exec is not found anymore. Testing with where (on windows) works.
Any Idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Glavin001 now everything should be fixed.
src/beautifiers/terraformfmt.coffee
Outdated
} | ||
|
||
beautify: (text, language, options) -> | ||
@run("terraform", [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Executables feature.
# Before
@run("terraform", [
# After
@exe("terraform").run([
src/beautifiers/terraformfmt.coffee
Outdated
isPreInstalled: false | ||
|
||
options: { | ||
Terraform: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be false
indicating Language is supported with no/zero support for options.
src/options.json
Outdated
"tf" | ||
], | ||
"properties": { | ||
"indent_size": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix Terraform: true
above and rerun generate docs.
I don't think there is a I think you meant |
For the question regarding postinstall I used this: https://github.com/Glavin001/atom-beautify/blob/master/docs/add-languages-and-beautifiers.md |
Oh thanks for letting me know! Looks like the docs are out of date.
Would you be able to change those docs in your Pull Request, too, please? Thanks! |
I am not sure what I have to change to fix the issues. Can you support here ? |
Hi @derBroBro you need to have Terraform installed on both the AppVeyor (WIndows) and Travis CI (Linux and MacOS) build files for the tests to pass. .travis.yml for Travis and appveyor.yml for AppVeyor. For Travis, you can use uncrustify as an example, as it looks like there is a Homebrew formula for Terraform: http://formulae.brew.sh/formula/terraform. Basically if the OS is OSX, |
Thank you, now appveyor looks ok, travis throws |
There's an issue with Homebrew on Travis, uncomment line 95: https://github.com/Glavin001/atom-beautify/blob/master/.travis.yml#L95 and push it again. |
Worked, I think with this the I changed everything. |
@Glavin001 anything I can to finish the PR? |
Hello, any updates here? |
Looks good to me, I requested another review from Glavin. |
Reviewing now. I apologize, I have been unavailable to review Pull Requests lately. Let's see about getting this merged 😄 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! Awesome work.
Last part is removing old isPreinstalled
property from the beautifier and running npm run docs
to make sure the docs are up-to-date -- I think they are, best to be sure.
Let's try to get this merged and into the next release! 😃
src/beautifiers/terraformfmt.coffee
Outdated
module.exports = class Terraformfmt extends Beautifier | ||
name: "terraformfmt" | ||
link: "https://www.terraform.io/docs/commands/fmt.html" | ||
isPreInstalled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isPreInstalled
should be removed. See
atom-beautify/src/beautifiers/beautifier.coffee
Lines 40 to 41 in 49982c6
isPreInstalled: () -> | |
@executables.length is 0 |
Looks like merge conflicts now, too. Once resolved, should be good to go! |
Awesome! Thank you for contributing! |
Published to v0.30.6 |
What does this implement/fix? Explain your changes.
This adds support for terraform fmt.
Does this close any currently open issues?
Yes - #645
Any other comments?
Hope all fits.
Did not work.
As I am no fulltime dev it would be great if you can guide me what else I have to deliver.
Checklist
Check all those that are applicable and complete.
master
branchnpm run docs
CHANGELOG.md
under "Next" section