Commit Graph

58 Commits

Author SHA1 Message Date
c-parsons 9992d61921
add cparsons and bttk to the CONTRIBUTORS file (#73) 2018-11-20 15:19:06 -05:00
c-parsons 58f9c41304
make sets.bzl compatible with --incompatible_depset_is_not_iterable (#71) 2018-11-20 13:19:38 -05:00
bttk 3b30154839 Use transitive_files in runfiles instead of a list of files (#69) 2018-11-14 18:52:55 +01:00
Thomas Van Lenten b12cc99ee3
Use Xcode 10.1 on the travis CI setup. (#66) 2018-11-14 12:33:18 -05:00
bttk db3ce78dc2 Remove supports for make(depset()) from new_sets (#68)
With `--incompatible_depset_is_not_iterable` depset is no longer
iterable. Remove tests that assumed it is.

Bazel issue:
https://github.com/bazelbuild/bazel/issues/5816
2018-11-14 18:10:38 +01:00
bttk 3360231ec0 Upgrade to the new actions API (#65)
In future Bazel releases ctx.file_action will be removed.
ctx.action.write should be used instead.

With this change tests pass even if --incompatible_new_actions_api
is used.

Bazel issue:
https://github.com/bazelbuild/bazel/issues/5825
2018-11-13 11:22:18 +01:00
Thomas Van Lenten 6ad5e286cb Cache the types to avoid fetching it every time. (#64)
Along the lines of the caching done in #62
2018-11-13 00:03:11 +01:00
TechSY730 7a9648fed6 Update to google style (#63)
* Update skylark_library.bzl to conform to Google's code style.
2018-11-12 12:42:57 -08:00
TechSY730 d17ca08d28 Make _precondition_only_sets_or_lists in sets.bzl not assume type() returns a string. (#62)
Such an assumption makes this check brittle in the face of potential future changes to type().
2018-11-12 19:44:29 +01:00
Julio Merino 8cecf885c8 Remove spurious newlines from fail/print messages (#60)
The fail() and print() primitives take strings without newlines in them
because the formatted output will already contain newlines.  Therefore,
remove them, which have been annoying me to no end when using rules_go
with a HEAD-built Bazel binary.

While doing this, also switch to using .format() consistently for all
strings, merge two related debug messages into the same print() call,
and fix grammar.
2018-10-18 16:04:01 -07:00
c-parsons 6e2d7e4a75
Rename a number of instances of 'skylark' to 'starlark' or 'bzl'
Most notably, this renames/moves a few important identifiers:

//:skylark_library.bzl -> //:bzl_library.bzl
skylark_library -> bzl_library
SkylarkLibraryInfo -> StarlarkLibraryInfo
2018-09-28 09:09:18 -04:00
Thomas Van Lenten 1099dd2d0a deprecate lib.bzl. (#58)
- tag the :lib target as such.
- print() a warning when lib.bzl is loaded.
2018-09-24 21:48:24 +02:00
Thomas Van Lenten e9fc4750d4 Move to Xcode 9.4 for testing. 2018-08-28 10:04:50 -04:00
Laurent Le Brun 0914f49694
Merge pull request #56 from thomasvl/avoid_lib
Remove usage and suggests for lib.bzl.
2018-08-27 16:19:16 +02:00
Thomas Van Lenten b5f4086001 Remove usage and suggests for lib.bzl.
As more things are added, lib.bzl is an anti-pattern as the cost of loading
it actually just keeps increasing and most things will never use everything
out of it.  The pattern the should be used is to directly import the modules
one uses.
2018-08-24 15:00:13 -04:00
Thomas Van Lenten ca5f717eba Update the module list. 2018-08-24 14:45:54 -04:00
Thomas Van Lenten c0b0c4400e Fix executable bit on selects.bzl 2018-08-24 14:45:54 -04:00
Thomas Van Lenten 7490380c6b No need to list visibility that matches the default. 2018-07-27 12:53:08 -04:00
oquenchil 6301f974f0
Makes package public by default
When creating a skylark_library A anywhere downstream, if a bzl file in A loads() any of the bzl libraries in this package, then the bzl files in this package will have to be in deps as a skylark_library. The current public filegroup cannot be used as a dependency of skylark_libraries.
2018-06-27 10:22:33 +02:00
Thomas Van Lenten 3fea8cb680 Add missing dep 2018-06-13 14:17:14 -04:00
Thomas Van Lenten 3b6bba355c Fix up skylint issues. 2018-06-13 11:59:47 -04:00
Thomas Van Lenten e5203c0f5d Reformat .bzl files with buildifier and add format check.
Buildifier 0.12.0 includes initial support for reformatting .bzl files.
- Reformat all the bzl files.
- Expand the travis check to check the .bzl files also.
2018-06-13 10:58:35 -04:00
Thomas Van Lenten a5431b7bab Update check to use buildifier's exit status instead.
buildifer 0.12.0 release sets the exit status for diff.
2018-06-12 13:35:31 -04:00
Laurent Le Brun 9430df29e4
Merge pull request #43 from ttsugriy/type_defs
Add type checking functions.
2018-05-10 19:04:01 +02:00
Taras Tsugrii b09d5d41b2 Add type checking functions.
Even though it's not great to use type checks, they are frequently useful for
checking input types of macros.

Because there is no standard way of checking types, at least 2 types of checks
are used:
- `type(foo) == type([])`
- `type(foo) == "list"`

The first option is not very readable and the second option seem to be relying
on an Bazel implementation detail. Encapsulating type checks into this library
enables consistent and easy to understand type checking without explicitly
relying on implementation details.
2018-05-09 10:55:40 -07:00
dmaclach 4eb28c458c Add support for repr/str to new_sets (#42) 2018-05-04 15:39:54 -07:00
Thomas Van Lenten 809940bf89 Skylint: stop using ctx.outputs.executable.
Be explicit about the file create/to run instead of using
ctx.outputs.executable.
2018-05-01 14:34:36 -04:00
Thomas Van Lenten c8dae2702f
Address skylint warnings on the tests. (#39)
* Skylint: Move comment out of docstring.

Is skylint seems more than a single like docstring, it expect a full comment
with Args/Returns/etc.; avoid having to have full docstring but just making
the comment a comment and not part of the docstring.

* Address some skylint issues.

- ctx.file_action -> ctx.actions.write
- Return an empty list of providers rather then an old style empty struct.
2018-05-01 14:12:52 -04:00
Thomas Van Lenten 2d356cf857 Doc and code fixes found via skylint. (#38)
* Fix up the skylint warning about depset usage.

* Remove the reassignment of max_bazel_version.

This was flagged by skylint, the reality is _is_at_most() does the parsing
so it shouldn't be parsed before sent on the way.

* Fix up the skylint warning about depset usage.

* Fixup the skylint warning about re-exports.

Just move to the explicit re-export form.

* Fix the fail() call to use the right variable.

skylint flagged this variable as undefined, but it it seems like this
was never right and should have been "key" all along.

* Fixup docstring formatting for skylint.
2018-04-26 12:08:01 -04:00
Nicholas Titcombe 0b40ea7b13 Introduce new_sets.bzl (#32)
This version is hash-based (implemented on top of a dictionary) and doesn't suffer the performance problems of the current version. It will eventually replace the old one after a deprecation period.
2018-04-20 14:44:25 -07:00
Thomas Van Lenten 59fba13160 Move to Xcode 9.3 which also means a High Sierra image. (#37) 2018-04-20 13:00:15 -07:00
Tony Allevato c8e163653a
Minor spacing cleanup. (#35) 2018-04-17 09:52:23 -07:00
dmaclach d46b607d98 Add support for 'functools.partial' like functionality. (#34)
* Add support for 'functools.partial' like functionality.

https://docs.python.org/3/library/functools.html#functools.partial
2018-04-17 09:33:38 -07:00
Thomas Van Lenten a5e23fd4c0 Drop the rc file flag.
Hopefully no file(s) exists on travis, and with the changes coming in bazel
(https://github.com/bazelbuild/bazel/issues/4502#issuecomment-372697374)
trying to ensure no files will become version dependent.
2018-03-14 13:37:28 -04:00
Thomas Van Lenten dd4cdb95c7 Don't special case current directory relative paths. 2018-03-07 14:30:43 -05:00
Thomas Van Lenten a60d9f83df Test HEAD bazel on travis.
- Add support for fetch HEAD bazel from their new setup.
- Switch travis to building with HEAD since bazel's ci is using the last release.
2018-03-01 09:17:31 -05:00
Thomas Van Lenten 08a89e561a Fix the buildkite link. 2018-02-28 13:53:36 -05:00
Thomas Van Lenten 1fd390cc1d Travis updates for bazel moving to buildkite.
Disable the HEAD build, as we don't have a way to download the bazel
binary at the moment.  bazel.build.ci should provide that instead.
2018-02-28 13:12:53 -05:00
Jakob Buchgraber 7441e21c9b add buildkite to bazel's new ci
we'll run skylib as a postsubmit project and
before every release to ensure we don't break
it.
2018-02-28 08:31:03 -08:00
Tony Allevato 7c3deb495a Add "Getting Started" section to README 2018-02-28 07:57:27 -08:00
Thomas Van Lenten 912a12b697 Travis improvements.
- Move install into a stand alone script to expand it.
  - Support installing the latest bazel release.
- Move the script step into a stand along script to expand it.
  - Support doing a build or running buildifier.
- Update the config to:
  - Use the latest bazel release and head for tests (won't have
    to update the config with each bazel release).
  - Add a buildifer test to ensure the files are good.
2018-02-26 15:42:20 -05:00
Thomas Van Lenten f9b0ff1dd3 Add missing versions to the library. 2018-02-20 16:54:27 -05:00
Thomas Van Lenten a5d9a18062 Support no_match_error in selects.with_or(). 2018-02-20 16:54:13 -05:00
Thomas Van Lenten f6b414b007 Fix grammar. 2018-02-20 16:53:50 -05:00
Thomas Van Lenten 0fa0b2ae07 Add a skylib for versions. 2018-02-20 16:28:27 -05:00
Thomas Van Lenten a95326eb78 Format the with buildifier. 2018-02-20 16:28:12 -05:00
Thomas Van Lenten 87e4c93a41 Add travis setup to test on linux and macOS 2018-02-20 15:54:21 -05:00
Dmitry Lomov ff23a62c57
Merge pull request #15 from ianthehat/is_absolute
Fix paths.is_absolute on windows
2018-01-18 17:09:59 +01:00
Ian Cottrell 771fedb260 Fix paths.is_absolute on windows 2018-01-18 11:04:01 -05:00
Jay Conrod 2169ae1c37 versions.bzl: skip check if native.bazel_version is None
_check_bazel_version prints a warning in this case, but then attempts
to parse and check None. It should return early.
2018-01-12 11:25:06 -08:00