X Tutup
Skip to content

SwiftPM support#467

Merged
asottile merged 9 commits intopre-commit:masterfrom
benasher44:basher_swiftpm_support
Jan 17, 2017
Merged

SwiftPM support#467
asottile merged 9 commits intopre-commit:masterfrom
benasher44:basher_swiftpm_support

Conversation

@benasher44
Copy link
Contributor

@benasher44 benasher44 commented Jan 13, 2017

This implements #451.

All that's needed to build a SwiftPM package is to runswift build. When doing this, you choose either a debug or release type build, and then build artifacts/binary is stored in <build_dir>/<release|debug>. The -C flag is just used to ensure swift build is run with the repo as the current directory, which apparently wasn't the case when I tested the first time.

@benasher44
Copy link
Contributor Author

I still have to add a hooks.yaml to SwiftLint, as well as finish implementing realm/SwiftLint#810, but realm/SwiftLint#810 should be enough, since you could get away with specifying the hooks.yaml details locally in your .pre-commit-config.yaml.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

niiiiiice

some simple tests too (we talked about this in irc)

ENVIRONMENT_DIR, 'default',
))
cmd = helpers.to_cmd(hook)
full_binary_path = os.path.join(directory, BUILD_DIR, BUILD_CONFIG, cmd[0])
Copy link
Member

Choose a reason for hiding this comment

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

instead of doing this, let's do a PATH envcontext (see any of the python / ruby / js ones for an example). Then you can just use helpers.to_cmd directly

additional_dependencies=(),
):
directory = repo_cmd_runner.path(helpers.environment_dir(
ENVIRONMENT_DIR, 'default',
Copy link
Member

Choose a reason for hiding this comment

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

I would assert that the version is default since no other version is supported, there's prior art in the docker language

@asottile
Copy link
Member

I added some commits to your branch :)

@benasher44
Copy link
Contributor Author

\o/

@asottile asottile merged commit ba09a2d into pre-commit:master Jan 17, 2017
@asottile
Copy link
Member

Thanks and wow!

@benasher44
Copy link
Contributor Author

🎉🎉🎉 thank you!

@asottile
Copy link
Member

I'll cut a release for this tomorrow

@asottile
Copy link
Member

Damn I'm a liar, doing this now <3

@asottile
Copy link
Member

This is in 0.11.0, thanks again for an awesome contribution. Want to write up a bit in the documentation and add your name to the contributors? https://github.com/pre-commit/pre-commit.github.io (fork and base a branch off of real_master)

@benasher44
Copy link
Contributor Author

Sure! I'll do it soon. I wanna wait for my swiftlint PRs to ship, so that I can have an example for the docs.

@asottile
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup