Commit Graph

273 Commits

Author SHA1 Message Date
Kevin Kress cc51024fc2
Add subpackages module to skylib to support new bazel native.subpackages (#348) 2022-04-04 17:56:21 -04:00
Vertexwahn 2a87d4a62a
Add expand_template rule (#330)
Resolves: https://github.com/bazelbuild/bazel-skylib/issues/191

An example of how this can be useful can be found here: https://github.com/catchorg/Catch2/pull/2387/files

Could be also helpful here: 8587f4eed1/BUILD.bazel (L21)
2022-04-01 18:07:48 -04:00
Alexandre Rostovtsev b9ec2c2dbb
Allow using python3 for timestamps on macOS and BSD (#362)
Note that macOS 12.3 removed python2.
2022-04-01 10:00:11 -04:00
Geoffrey Martin-Noble 8e2ba6e9df
Fix runfiles in native_binary/native_test (#339)
The current implementation misses the runfiles from the binary itself
since the attribute for it is called `src` not `srcs` and it makes use
of the discouraged `collect_data` and `collect_default` parameters which
depend on hardcoded attribute names.
2022-03-29 17:41:48 -04:00
Alex Eagle bd79f922c9
Add diff_test asserting that docs are up-to-date (#321)
Based on Aspect's stardoc_with_diff_test; see https://github.com/aspect-build/bazel-lib/blob/main/docs/docs.md
2022-03-29 15:14:07 -04:00
Alexandre Rostovtsev b669088a95
Update dicts documentation. (#361) 2022-03-28 12:06:10 -04:00
Barry McNamara 8334f938c1
Implement omit and pick dicts functions. (#304) 2022-03-17 16:49:06 -04:00
Alexandre Rostovtsev ee67264452
Update changelog and version for release 1.2.1 (#360)
Make a point release to unbreak users who set `--incompatible_disallow_empty_glob`. See discussion in https://github.com/bazelbuild/bazel-skylib/pull/359
2022-03-10 11:31:05 -05:00
Alexandre Rostovtsev 898cd6ddff
Remove unused, empty //rules:bins filegroup, allowing us to simplify distribution/BUILD (#359)
//rules:bins has not been used since 14f17ae7f7

Alternative to https://github.com/bazelbuild/bazel-skylib/pull/358
2022-03-10 07:41:11 -05:00
Alexandre Rostovtsev 5bffd04256
Add a maintainer's guide (#356) 2022-02-23 20:06:15 -05:00
Ivo List e30197f379
Extend owners of skylib. (#355) 2022-02-23 09:43:39 -05:00
Alexandre Rostovtsev c4dfec1bf1
Update changelog and version for release 1.2.0 (#350) 2022-02-11 12:02:05 -05:00
UebelAndre cdd0afdfe6
Fixed positional args for unittest targets (#352)
Followup to https://github.com/bazelbuild/bazel-skylib/pull/343
2022-02-10 17:55:11 -05:00
UebelAndre 2bc90bdf7d
Allow unit test rules to be documented (#343)
I find it more ergonomic to add notes or a description about a test to a `doc` attribute, similar to other rules, vs a comment block above it or in the `impl` function docstring. Hopefully this can improve the readability of test rules.
2022-02-10 17:00:29 -05:00
Kevin Kress 7270e3b345
Add support for 'loading' unit tests, which evaluate a LOADING phase. (#347)
This is a relatively simple addition to unittest that statically creates rules
that either explicitly fail or not depending on if the test case is valid during
LOADING phase of bazel.  The test conditions are evaluated entirely in loading
phase, but if we want an actual test to fail rather than just `fail()` killing
the build, we can use this to assert state and report test failures.
2022-02-10 16:03:48 -05:00
Alexandre Rostovtsev 1e1c324391
Fix linter warnings with new buildifier version. (#349) 2022-02-10 14:50:56 -05:00
Geoffrey Martin-Noble ecc11f9a4c
Fix name arg documentation for native_binary (#338) 2022-01-12 11:28:43 -05:00
Alexandre Rostovtsev 6e30a77347
Update internal dependencies to modern versions. Bazel Federation repo is deprecated. (#327)
See https://github.com/bazelbuild/bazel-federation/pull/127

In particular, this allows us to use a modern Stardoc release to fix generated md docs.

And we can remove internal_deps.bzl/internal_setup.bzl - it's unnecessary complexity
needed only for deprecated Federation setup.
2021-10-27 09:13:59 -04:00
Yesudeep Mangalapilly 8e923ca4b9
Use more portable `#!/usr/bin/env bash` shebang instead of hardcoded /bin/bash. (#329) 2021-10-25 09:12:41 -04:00
Samuel Freilich 506c17293e
Improve escaping in unittest failure message (#320) 2021-10-04 12:03:48 -04:00
Alexandre Rostovtsev b2ed61686e
Missing version number bump in version.bzl for the new release (#318)
Implying that the new release will have to be 1.1.1, not 1.1.0
2021-09-27 13:12:59 -04:00
Alexandre Rostovtsev 50d2680f5f
Update changelog for release 1.1.0 (#317) 2021-09-27 12:23:51 -04:00
Alex Eagle eabe5f7fe9
Run regenerate_docs.sh (#297)
Co-authored-by: Alexandre Rostovtsev <arostovtsev@google.com> (merge conflict fixes)
2021-09-24 11:24:43 -04:00
Thaler Benedek 43a545a67e
Make diff_test work on windows with --enable_runfiles (#314) 2021-09-24 10:49:07 -04:00
Mansur 14f17ae7f7
Windows support for build_test (#302) 2021-09-24 10:43:30 -04:00
Daniel Wagner-Hall 08398cdc99
Allow specifying additional aspects to tut (#299) 2021-09-23 16:21:58 -04:00
Alex Eagle df3c9e2735
diff_test: add ability for caller to specify a message printed on fai… (#307)
Useful for the use case of a pair of .test and .update targets for checked-in golden files
2021-08-18 11:23:43 -04:00
Philipp Wollermann 0c57e74606
Remove `$` from grep regexes (#311)
Due to grep having dropped support for handling line-ending matches in a cross-platform way, grepping for `...$` will now fail on Windows, as it no longer ignores the CR part of the CRLF line endings on Windows.

This should turn this project green again on Bazel CI.
2021-08-09 11:15:50 -04:00
dmaclach b053a5ae11
Update partial.bzl to generate better markdown (#309) 2021-07-26 15:26:28 -04:00
dmaclach 775f66fb28
Update partial_doc.md (#308)
Clean up the docs to make them look significantly better.

No semantics changes, just styling.
2021-07-14 21:55:10 -04:00
aiuto fd75066f15
update links to bazel docs (#306) 2021-06-16 13:00:06 -04:00
Alexandre Rostovtsev c6f6b5425b
Fix default branch name in README (#292)
See https://github.com/bazelbuild/bazel-skylib/branches and
https://github.com/bazelbuild/bazel-skylib/issues/281.
2021-05-13 10:22:43 -04:00
Alexandre Rostovtsev 7b859037a6
to_json/to_proto methods on structs are deprecated and will be removed (#295) 2021-05-03 12:27:40 -04:00
c-parsons 398f312289
lint warning fix (#115) 2021-03-31 16:06:00 -04:00
Olek Wojnar 82c1d0fa3e
Add shebang lines to tests directory shell scripts (#288) 2021-03-31 15:46:21 -04:00
Christopher Sauer b3ce9e70e5
Add write_file and copy_file docs to README (#291) 2021-03-31 15:34:15 -04:00
aiuto f80bc733d4
update owners (#289) 2021-01-29 13:38:17 -05:00
alandonovan e19d391ac9
Explain criteria for contributing (#286)
* Explain criteria for contributing

* Update README.md

* Update README.md
2020-12-17 17:20:24 -05:00
David Sanderson ed7f03cde6
Enable unittest.suite to accept partial calls of test rules (#276)
* Enable unittest.suite to accept partial calls of rules

This permits using `unittest.suite` with test rules that have nondefault
attributes, while retaining compatibility with current usage.

For instance, this permits setting a `timeout` on each test in a
`unittest.suite`.  Previously, all tests in a `unittest.suite` would
have the default timeout, with no good way to alter this.  This
made it hard to eliminate all the warnings produced from using the
`--test_verbose_timeout_warnings` bazel option.

While timeouts were the motivation, the solution here is not specific
to timeouts. It will permit arbitrary additional arguments to the test
rules in a `unittest.suite`.

Fixes #98

* Respond to review feedback.

* Document a breaking change in bazel that this code needs to be aware of.
2020-11-12 21:04:39 -05:00
Andrew Z Allen 182046f090
Handle "internal" directory visibility (#274)
Both "internal" and "private" directories should be treated the same way
and have visibility restrictions be placed upon them.
2020-10-21 23:52:14 -06:00
Andrew Z Allen b2ffc94b17
Gazelle now handles imports from `@bazel_tools` (#273)
`@bazel_tools` is tricky since it is effectively a part of the standard
library that can not have a `bzl_library` attached to it. As a simple
fix for this, `bzl_library` can have a srcs dependency on it so that it
includes the transitive closure of all of its dependencies.

`@bazel_tools` imports are rewritten into the `srcs` attribute since
they are `exports_files`ed from the @bazel_tools.

Co-authored-by: c-parsons <cparsons@google.com>
2020-10-19 12:49:17 -04:00
River a81c2c0efe
Regenerate new_sets.bzl docs. (#280)
Lists are not supported. The code comments were fixed to match this in 2d620ba1f8, but the docs were never updated.
2020-10-15 14:20:00 -04:00
Laurent Le Brun 528e424134
Remove laurentlb from CODEOWNERS (#279) 2020-09-25 22:55:01 +02:00
David Sanderson 56ec790c9b
Address latent buildifier issues. (#278)
In https://buildkite.com/bazel/bazel-skylib/builds/1240#annotation-buildifier
I noticed buildifier issues unrelated to my PR.
This PR attempts to address these latent buildifier issues.
2020-09-25 22:32:06 +02:00
Andrew Z Allen 2a89db4749
Fix CODEOWNERS (#275)
Previously permissions were granted to edit any file that existed in a directory
titled `gazelle`. Now grants have been given recursively.
2020-09-15 19:53:03 -04:00
Samuel Giddins 836f1b2f56
Add support for gazelle handling relative imports (#271) 2020-09-07 15:29:39 -06:00
aiuto 2ec2e6d715
update release notes for 1.0.3 (#270) 2020-08-27 10:01:44 -04:00
Ivo List bc97abb33e
Move bzl ext (#265)
* Move Gazelle extension to //gazelle/bzl and change package name

This fixes an issue with importing bazel-skylib into
google3. Currently, Glaze (internal Go build file generator) attempts
to generate a target (//gazelle:gazelle) that conflicts with one
that's already declared here.

I think the right solution is actually to move the package into a
subdirectory. In the future (bazelbuild/bazel-gazelle#5), Gazelle's Go
extension will generate target names similar to what Glaze does, so
the same conflict will happen in open source. I think it's also
logical to have a directory of packages in case more need to be added
in the future, and for the extension to have a package name matching
the language it works with.

This is an incompatible change, but the //gazelle directory isn't part
of a tagged release yet, so hopefully it won't break anyone.

* fix runfiles access in test

* Fix gazelle package names.

Co-authored-by: Jay Conrod <jayconrod@google.com>
2020-08-20 13:14:55 -04:00
c-parsons 68acaa5d6a
Improve inspect_output_dirs_test bin_dir comparison (#267)
This should fix some buildkite CI flows, ensuring success of
this test is no longer tied to the current compilation_mode.
It also improves the error message of the offending evaluation.
2020-08-20 13:06:59 -04:00
Ivo List dc080e9516
Prettify failure message of asserts.set_equals. (#263)
Before, when comparing large sets, the message dumped the whole set. Now it additionally prints missing and unexpected elements.
2020-08-11 14:52:32 +02:00