2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-06 21:20:25 +00:00
Commit Graph

183 Commits

Author SHA1 Message Date
Rashil Gandhi
43afae34be
Add PowerShell completion file (#1826) 2021-08-28 13:39:17 +02:00
Martin Nordholts
19c3e82abf
Replace deprecated 'error-chain' with 'thiserror' (#1820)
We can't use #[from] on Error::Msg(String) because String does not implement Error.
(Which it shouldn't; see e.g. https://internals.rust-lang.org/t/impl-error-for-string/8881.)
So we implement From manually for Error::Msg, since our current code was written
in that way for error-chain.
2021-08-26 13:12:21 +02:00
David Peter
ff70a80741 Add statically linked binaries for ARM 2021-08-22 15:52:23 +02:00
David Peter
ecdb17148d Use Ubuntu 20.04 instead of 18.04 2021-08-22 15:52:23 +02:00
a1346054
51edacb5eb style: trim excess whitespace 2021-08-21 23:07:37 +02:00
Martin Nordholts
cbd96237fd CICD: Add 'cargo fmt' check 2021-08-19 07:18:05 +02:00
Martin Nordholts
25fa577cd0 Make 'build-assets' an optional capability for application
Also structure features a bit more clever to avoid duplication of
feature dependency declarations.
2021-08-17 10:58:21 +02:00
Martin Nordholts
cb4973987b Cargo.toml: Introduce 'quick-build-application' feature
Use it like this:

  cargo build --no-default-features --features quick-build-application

It reduces dependencies to build from 154 to 125, allowing quicker iteration
when developing the app.
2021-08-08 11:18:26 +02:00
Martin Nordholts
697d106bd4 CICD: Pass --locked to all cargo commands
To avoid that earlier cargo commands "fixes" Cargo.lock before cargo commands
with --locked has a chance to check if it is up to date.
2021-08-02 21:49:51 +02:00
David Peter
fb1ab09e3e Add Enselic in FUNDING.yml 2021-07-26 20:11:34 +02:00
David Peter
84e2a2e5d1 Add custom FUNDING.yml 2021-07-25 12:30:40 +02:00
David Peter
fddd11a205 CICD: sync with pastel, minor changes 2021-07-05 17:24:59 +02:00
Ville Skyttä
e05f5010da Add bash completion
Closes https://github.com/sharkdp/bat/issues/1010
2021-06-28 11:58:03 +02:00
dependabot-preview[bot]
285b1556a9 Upgrade to GitHub-native Dependabot 2021-05-12 11:18:03 +02:00
Marco Ieni
8321cc661c
CI: check docs (#1612) 2021-05-12 07:20:12 +02:00
Martin Nordholts
8f93844427 CICD: Remove explicit allow of clippy::match_bool since MSRV 1.45 bump
Now that we are on MSRV 1.45, there is no need to "backport" the change
that reclassified clippy::match_bool as "pedantic".
2021-03-08 07:08:55 +01:00
David Peter
52f84b063c Update dependencies, MSRV: 1.45 2021-03-07 15:33:37 +01:00
David Peter
2540311cdf Update bug report issue template (--diagnostic option) 2021-03-01 08:27:07 +01:00
Martin Nordholts
9db9a38565 CICD: Add workflow_dispatch to enable manual builds
Which is useful when you want to test a fix without creating a PR for
it.
2021-02-28 16:27:40 +01:00
Martin Nordholts
0371f55541 CICD: Don't run jobs twice in PRs
Without this change, creating a PR triggers all jobs to run twice. Once
due to a push event and once due to a pull_request event.

Change to only trigger jobs due to push when pushing a tag or to the
master branch, to avoid duplicate jobs for each PR.
2021-02-22 21:45:52 +01:00
David Peter
bc35592fd9 CICD: Build step naming 2021-02-21 19:11:42 +01:00
David Peter
f5d834407e CICD: Improved job names 2021-02-21 11:16:30 +01:00
David Peter
557a748ac7 CICD: Remove code coverage computation 2021-02-21 10:24:27 +01:00
Martin Nordholts
3f10f71ad2 CICD: Build: Rename 'Check is release' step to 'Check for release'
To get a name that sounds like proper English.
2021-02-18 07:59:10 +01:00
Martin Nordholts
7b6388b19f CICD: Build: Add separate 'Calculate test options' step
And move it down to right before it is needed, to reduce its scope.

For #1474
2021-02-18 07:59:10 +01:00
Martin Nordholts
b98ec4bbc5 CICD: Build: Check IS_RELEASE in separate step
And move it closer to where it is actually needed, to reduce its scope.

For #1474
2021-02-18 07:59:10 +01:00
Martin Nordholts
94fd481f36 CICD: Build: Remove unused ${{ matrix.job.cargo-options }} expansions 2021-02-18 07:59:10 +01:00
Martin Nordholts
0e5ea9c354 CICD: Build: Use package-specific staging dir
A common staging dir confuses more than it helps, so let each package
step take care of its own staging dir.

For #1474
2021-02-16 21:53:54 +01:00
Martin Nordholts
eac36dd3b5 CICD: Build: Introduce and use new 'Strip release bin' step
So that we don't have to duplicate that logic in both 'Debian package'
and 'Package' steps.

For #1474
2021-02-16 07:27:44 +01:00
Martin Nordholts
d36b091fd7 CICD: Build: Move PKG_* vars to 'Package' step
For improved modularization of CICD script.

For #1474
2021-01-11 22:18:49 +01:00
Martin Nordholts
3dcf02549e CICD: Build: Move DPKG_* vars to 'Debian package' step
For cleaner CICD script. Note that we can't use outputs defined in our
own step, so also change to shell vars intead.

For #1474
2021-01-11 22:18:49 +01:00
Martin Nordholts
e402011a73 CICD: Build: Split out dir creation into the individual package steps
It's cleaner because we can reuse helper vars and create the dirs closer
in time to when they are needed.

For #1474
2021-01-11 22:18:49 +01:00
Keith Hall
b25713938d
Fix typo in bug report template 2021-01-11 15:40:03 +02:00
Martin Nordholts
221c9815a5 CICD: Build: Split up into separate 'Debian package' step
Make sure to ignore whitespace changes when diffing.

For #1474
2021-01-10 20:44:03 +01:00
Martin Nordholts
c5c683f67c Explicitly allow clippy::match_bool until we bump MSRV
Since we run clippy on Rust 1.42.0 we still get warnings about the
presence of clippy::match_bool lints. That lint has been moved from
'Style' to 'Pedantic' in Rust 1.45.0 and onwards however, so let's
silent it in our clippy runs too.
2021-01-10 20:38:16 +01:00
sharkdp
faa27ed6e3 CICD: simply use 'sed' to extract crate information 2021-01-10 14:44:46 +01:00
sharkdp
f3227c259e Use cache for faster install 2021-01-10 14:44:46 +01:00
sharkdp
2cfeebab90 CICD: Use 'cargo get' to extract crate metadata 2021-01-10 14:44:46 +01:00
Martin Nordholts
e3b1142364 CICD: Build: DEPLOY -> IS_RELEASE and inline it
This simplifies and clarifies the script.

For #1474
2021-01-10 10:56:15 +01:00
Martin Nordholts
8832ff3c6a CICD: Build: Adapt release version regex to bat
All bat tags begin with a small 'v', so no need for a generic pattern in
the CI script. This will also help us ensure we keep the same format on
future tags.
2021-01-10 10:56:15 +01:00
Martin Nordholts
505ff10dc6 CICD: Build: Always build and upload Debian packages
Not only when a release tag is pushed. Also publish these Debian
packages as artifacts. This makes PR workflows more similar to release
work flows, and reduces risk of build system regressions that we don't
detect until we make a new release.

For #1474
2021-01-10 10:56:15 +01:00
Martin Nordholts
9a3a5545e7 CICD: Build: Use Cargo.toml version instead of tag
This enables us to later always build Debian packages. If you try to use
a git sha as Debian package version you will get an error:

    dpkg-deb: error: parsing file '_staging/dpkg/DEBIAN/control' near line 2 package 'bat':
     error in 'Version' field string 'd2963ce4': version number does not start with digit

so we need to use a version that is always available.

We duplicate the bat version in another place here which is a bit bad,
but it is already duplicated a lot, so we don't make things
significantly worse. It is still kind of nice to not have to figure out
a good and robust way to parse out the version from Cargo.toml in the CI
script.

For #1474
2021-01-10 10:56:15 +01:00
Martin Nordholts
43919066ad CICD: Use fixed OS versions instead of 'latest' ones
This reduces the risk of the build suddenly breaking, and fixes this
current warning:

    Ubuntu-latest workflows will use Ubuntu-20.04 soon.
    For more details, see https://github.com/actions/virtual-environments/issues/1816

I've use the mapping found at
https://github.com/actions/virtual-environments, so there should be no
actual change in OS versions, only semantically so.
2021-01-10 10:46:45 +01:00
sharkdp
19b8c53c46 Enable clippy::style checks 2021-01-09 19:43:39 +01:00
mark chaitin
de6cb75f4b Addressed PR feedback. Upped min version and used matches! macro 2021-01-09 15:21:26 +01:00
Martin Nordholts
7ffb04a17a CICD: Build: Make 'Upload build artifacts' more like deploy
The end goal is to upload the same artifacts for a PR as we deploy
during a release, to make a regular PR pipeline as similar as possible
to a deploy.

The first step is to move 'Upload build artifacts' to after 'Package' so
we can upload the same files. Also change the name and artifacts to be
more similar to what we deploy for a release.

For #1474
2021-01-09 14:31:19 +01:00
Martin Nordholts
e22a9a69b1 CICD: Build: Stop building on Ubuntu 16.04
End-of-life is in three months, and we already do the same build on
Ubuntu 18.04.
2021-01-09 08:30:54 +01:00
Martin Nordholts
59f9adc706 CICD: Build: Add and use disable-deploy matrix var
This results in a nicer workflow file that is easier to follow.

Also remove the unneccesary doc row that repeats what is already in the
matrix and that is annoying to keep up to date.

For #1474
2021-01-09 08:30:54 +01:00
Martin Nordholts
411d68e839 CICD: Build: Remove unused JOB_DO_TESTING var and output
It is CARGO_TEST_OPTIONS that is used to control testing on
cross-compiled builds, so we can remove JOB_DO_TESTING.

For #1474
2021-01-08 19:54:25 +01:00
Martin Nordholts
77d42a17c6 CICD: Build: Remove unused PKG_suffix output var
Only the env var is used, so output variant is not needed.

For #1474
2021-01-08 19:54:25 +01:00
Martin Nordholts
e7c55bffe9 CICD: Build: Remove unused TARGET_* vars and outputs
For #1474
2021-01-08 19:54:25 +01:00
Martin Nordholts
b6b7262962 CICD: Build: Use matrix.job.use-cross directly
There is no need for a var and set-output detour.
2021-01-07 10:55:29 +01:00
Martin Nordholts
3ed83913b2 CICD: Build: Remove unused REF_* outputs
There is no usage of `steps.vars.outputs.REF_*` so no need to setup such
things. Also remove setting up REF_NAME and REF_BRANCH env vars, since
they are never read.
2021-01-07 10:54:00 +01:00
Martin Nordholts
63460f4bf9 CICD: Build: Remove conditional TOOLCHAIN logic
because we always use "stable". If we need to go back to using
matrix.job.toolchain, we should do it like in jobs.coverage, instead of
messing about with vars and outputs.
2021-01-06 23:11:24 +01:00
Martin Nordholts
c67b439752 CICD: Build: Enable x86_64-pc-windows-gnu again
All the referenced issues [1] have been Closed, so use "stable" for
everything. Now `i686-w64-mingw32-gcc` fails with this instead

    error: linker `i686-w64-mingw32-gcc` not found

so keep it disabled. There is probably a simple solution for this that
is obvious to someone used to cross-compiling Rust programs on
Windows...

[1]
https://github.com/rust-lang/rust/issues/47048
https://github.com/rust-lang/rust/issues/53454
https://github.com/rust-lang/cargo/issues/6754
2021-01-06 23:11:24 +01:00
sharkdp
99a61580e1 Add --diagnostic run to CI 2021-01-06 22:53:51 +01:00
Martin Nordholts
5e1f9fadf4 CICD: Code Coverage: Explain why disabled 2021-01-06 22:34:03 +01:00
Martin Nordholts
fe08de846d CICD: Code Coverage: Disable for now 2021-01-06 22:34:03 +01:00
Martin Nordholts
78aed2cb69 CICD: Remove use-cross when host == target 2021-01-06 20:05:53 +01:00
Martin Nordholts
939a6a5f4d
CICD: Remove duplicate set-output calls (#1479)
The ::set-output syntax is the correct one according to
https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter,
so remove duplicates without that syntax.
2021-01-06 12:30:34 +01:00
Martin Nordholts
caf0743811 CICD: Code Coverage: Use matrix.job.toolchain directly
No need for complicated var and set-output logic when we can simply use
matrix.job.toolchain directly.
2021-01-06 11:58:31 +01:00
sharkdp
8381945cb5 Update formatting 2021-01-03 21:18:54 +01:00
David Peter
2046b47739 Move "diagnostics" part to the bottom of the bug report template 2021-01-03 21:16:56 +01:00
Janek
0c302f088a Update bug_report.md 2021-01-03 21:16:56 +01:00
Janek
a41db63907 Update bug_report.md 2021-01-03 21:16:56 +01:00
Janek
3573c48e98 bug_report.md: improve wording 2021-01-03 21:16:56 +01:00
Janek
e94980bfd0 bug_report.md: move environment prompt back up 2021-01-03 21:16:56 +01:00
Janek
5422982207 Update bug_report.md 2021-01-03 21:16:56 +01:00
Martin Nordholts
c0d945c0ac Allow clippy::style lints
Turns out GitHub is clever enough to pick up clippy warnings from us
just running it, and showing them in PRs under a "Unchanged files with
check annotations (beta)" header.

The only warnings currently shown are style warnings, and we agreed we
don't want to risk putting off contributors over style issues. So
explicitly allow (don't warn in the logs for) this category of clippy
lints.

This means that the only clippy categories left that prints warnings
(Warn) are:

    clippy::complexity
    clippy::perf

And the only category of lints that fails the CI build (Deny) remains to
be:

    clippy::correctness

See https://rust-lang.github.io/rust-clippy/master/index.html for a
catalog of all lints.
2020-12-30 11:46:56 +01:00
Martin Nordholts
2765c6ba3b clippy: Only enforce 'correctness' lints, just print the rest
Only the 'correctness' category of lints are 'deny' by default. This is
the only clippy lints we want to enforce for now. The other ones we just
want to print in the logs. So remove any --deny and --allow arguments.
See discussion in #1410.
2020-12-28 14:22:56 +01:00
Martin Nordholts
28f3f3c9c9 Add Clippy linter step to CICD
Run the linter on the minimum supported rust version; otherwise we will
get lint warnings for things that require a too high Rust toolchain
version to fix.

Allow the following checks, since we already violate them our code:
- clippy::new-without-default
- clippy::match-bool
- clippy::if_same_then_else

Eventually we should fix these lint issues and then disallow them to
prevent them from coming back in other places.

The clippy args used is recommended here:
https://github.com/rust-lang/rust-clippy#travis-ci
2020-12-28 14:22:56 +01:00
chris48s
c1e4746d50 change docs dir name to match package name
i.e: docs for bat-musl go in /usr/share/doc/bat-musl
not /usr/share/doc/bat
2020-12-21 09:23:56 +01:00
chris48s
8331eec7fc include changelog in package
in line with debian changelog/release notes guidance
https://www.debian.org/doc/debian-policy/ch-docs.html#changelog-files-and-release-notes
resolves changelog-file-missing-in-native-package
https://lintian.debian.org/tags/changelog-file-missing-in-native-package.html
2020-12-21 09:23:56 +01:00
chris48s
0547068ed0 include years in copyright notice
This brings the copyright notice into line with the expected format
resolves copyright-without-copyright-notice
https://lintian.debian.org/tags/copyright-without-copyright-notice.html
2020-12-21 09:23:56 +01:00
chris48s
18d8389785 ensure copyright is mode 644
resolves non-standard-file-perm
https://lintian.debian.org/tags/non-standard-file-perm.html
2020-12-21 09:23:56 +01:00
chris48s
165d25d941 remove leading article from description
resolves description-synopsis-starts-with-article
https://lintian.debian.org/tags/description-synopsis-starts-with-article.html
2020-12-21 09:23:56 +01:00
chris48s
c4fb77b042 invoke gzip with -n
resolves package-contains-timestamped-gzip
https://lintian.debian.org/tags/package-contains-timestamped-gzip.html
2020-12-21 09:23:56 +01:00
chris48s
d124ebeced only try to publish one set of archives/packages for linux x64 2020-11-29 11:10:37 +01:00
David Peter
277cc5fa21 Revert "invoke gzip with -n"
This reverts commit 21de52ebea.
2020-11-23 14:32:30 +01:00
David Peter
0cbd7d583c Revert "remove leading article from description"
This reverts commit 7c730d11c3.
2020-11-23 14:32:30 +01:00
David Peter
3c3fc92863 Revert "ensure copyright is mode 644"
This reverts commit 4a6b4fb632.
2020-11-23 14:32:30 +01:00
David Peter
e69d650598 Revert "include years in copyright notice"
This reverts commit 9f91a7d797.
2020-11-23 14:32:30 +01:00
David Peter
9385c81882 Revert "include changelog in package"
This reverts commit 1d4cee11b7.
2020-11-23 14:32:30 +01:00
David Peter
1b84f9f1ae Revert "add Depends line"
This reverts commit 883cc964ae.
2020-11-23 14:32:30 +01:00
David Peter
d879fbd8a1 Revert "change docs dir name to match package name"
This reverts commit e4370d8d3f.
2020-11-23 14:32:30 +01:00
Janek
2b82203041 Update bug_report.md 2020-11-06 21:45:25 +01:00
sharkdp
9dd807344c Ignore 'all_themes_are_present' unit test by default 2020-10-25 08:18:55 +01:00
谭九鼎
e31e35c46b CI: use checkout v2 2020-10-03 13:13:40 +02:00
Kienyew
2d1a92b7cc Fix zsh completion path 2020-10-01 22:09:59 +02:00
Kienyew
d9e8bbcb10 Handle zsh completion when packaging 2020-09-14 11:28:09 +02:00
chris48s
e4370d8d3f change docs dir name to match package name
i.e: docs for bat-musl go in /usr/share/doc/bat-musl
not /usr/share/doc/bat
2020-08-12 06:47:58 +02:00
chris48s
883cc964ae add Depends line
Use dpkg-shlibdeps to work out shared library dependencies
and include them in a "Depends:" line

resolves missing-depends-line
https://lintian.debian.org/tags/missing-depends-line.html
2020-08-12 06:47:58 +02:00
chris48s
1d4cee11b7 include changelog in package
in line with debian changelog/release notes guidance
https://www.debian.org/doc/debian-policy/ch-docs.html#changelog-files-and-release-notes
resolves changelog-file-missing-in-native-package
https://lintian.debian.org/tags/changelog-file-missing-in-native-package.html
2020-08-12 06:47:58 +02:00
chris48s
9f91a7d797 include years in copyright notice
This brings the copyright notice into line with the expected format
resolves copyright-without-copyright-notice
https://lintian.debian.org/tags/copyright-without-copyright-notice.html
2020-08-12 06:47:58 +02:00
chris48s
4a6b4fb632 ensure copyright is mode 644
resolves non-standard-file-perm
https://lintian.debian.org/tags/non-standard-file-perm.html
2020-08-12 06:47:58 +02:00
chris48s
7c730d11c3 remove leading article from description
resolves description-synopsis-starts-with-article
https://lintian.debian.org/tags/description-synopsis-starts-with-article.html
2020-08-12 06:47:58 +02:00
chris48s
21de52ebea invoke gzip with -n
resolves package-contains-timestamped-gzip
https://lintian.debian.org/tags/package-contains-timestamped-gzip.html
2020-08-12 06:47:58 +02:00
sharkdp
9110b00e2e Rebuild bat with new assets 2020-08-03 15:59:53 +02:00
sharkdp
49370e2175 Add CI job 2020-08-03 15:59:53 +02:00
sharkdp
9e0fab16ff Fix here-doc indentation, part 2 2020-08-02 21:51:23 +02:00