Commit graph

463 commits

Author SHA1 Message Date
Henrik Lissner
f281971206
feat(ci): generalize 'doom ci deploy-hooks'
By default, 'doom ci deploy-hooks' would deploy Doom's git hooks in
$EMACSDIR (~/.emacs.d/.git/hooks). Now it deploys in the local repo its
run in. This is part of an effort to generalize Doom's CI for use
outside this repo.

Ref: 4bae9ffa47
2022-05-05 15:35:33 +02:00
Henrik Lissner
4bae9ffa47
refactor(ci): generalize commit linter api
Continues from 47d1b82 as part of an effort to generalize Doom's CI for
use outside this repo:

- 'doom ci ...' commands now:
  - Run in the context of the local repo where they're run, rather than
    from Doom's install directory ($EMACSDIR).
  - Load the first of $REPO_ROOT/.github/ci.el, $DOOMDIR/cli.el, or
    $DOOMDIR/cli.el, before executing CI commands. This allows for
    per-project configuration, for example:
    - https://github.com/doomemacs/doomemacs/blob/master/.github/ci.el
    - https://github.com/doomemacs/themes/blob/master/.github/ci.el
    (Details may change post-3.0)
- Scopeless commit types are now enforced in `doom-cli-commit-scopes`,
  rather than `doom-cli-commit-rules`. This lets you specify exceptions,
  like 0597466261.
- `doom-cli-commit-scopes` now supports sub-lists, as an easy way to
  permit type-local scopes. E.g. To allow 'install' and 'faq' scopes
  only for 'docs:' commits.

    (add-to-list 'doom-cli-commit-scopes '(docs "install" "faq"))

  These sublists accepts predicates too.
- Fixed the link to git conventions in the linter's failure/warning
  output, to point to our Discourse post.

Ref: https://github.com/doomemacs/doomemacs/blob/master/.github/ci.el
Ref: https://github.com/doomemacs/themes/blob/master/.github/ci.el
Ref: 0597466261
Amend: 47d1b82382
2022-05-05 15:32:35 +02:00
Henrik Lissner
47d1b82382
tweak(ci): generalize commit linter defaults
So Doom can be used for general CI/CD (as part of doomemacs/ci). These
settings can be configured in .github/ci.el by default.

Ref: 0f6a653a13
2022-05-04 22:44:28 +02:00
Henrik Lissner
fbfc635300
fix(cli): GIT_CONFIG* envvars leaking child processes
When launching Doom via 'doom run', the child process inherits
bin/doom's environment. This change restricts this sub-environment to
the intended target: straight and its use of git.

Fix: #6320
2022-04-21 22:36:36 +02:00
Itai Y. Efrat
3a3c66df18 docs: add doctor warning about lack of nativecomp 2022-04-12 02:32:53 +02:00
Itai Y. Efrat
5cef63658d docs: update doctor living on the edge check to 29+ 2022-04-12 02:32:53 +02:00
Henrik Lissner
cf79616202
fix(cli): remove debug error call in 'doom version'
Accidentally snuck into dcae7187b4.

Amend: dcae7187b4
2022-04-01 19:12:35 +02:00
Henrik Lissner
806d9c0116
fix(cli): remove bufler from excluded autoloads
I was discussing issues generating autoloads files from some packages
with someone on Discord, and they mentioned issues with
alphapapa/bufler.el, so I added doom-autoloads-excluded-files in
5d0f781062, and also added bufler to it by default. In hindsight, that
doesn't make much sense as a default when Doom and its modules don't
even install bufler (and even if they did, this shouldn't be done in
core).

Ref: 5d0f781062
2022-03-31 19:25:49 +02:00
Henrik Lissner
da1eb4d107
refactor(cli): minor refactors and comment revision 2022-03-31 19:25:49 +02:00
Henrik Lissner
a9c22b704b
fix(cli): ignore system/user git configs
So they don't interfere with straight in odd, unpredictable ways. If
you *really* know what you're doing, set DOOMGITCONFIG to the path of a
gitconfig file. This envvar may be renamed in the future, however.

Close: #5640
Co-authored-by: M. Yas. Davoodeh <Davoodeh@users.noreply.github.com>
2022-03-31 01:06:07 +02:00
Henrik Lissner
9d1513af46
bump: :core
bbatsov/projectile@0243ad7dc9 -> bbatsov/projectile@f3468e8d20
domtronn/all-the-icons.el@2c963ebb75 -> domtronn/all-the-icons.el@65c496d3d1
jscheid/dtrt-indent@926fc4260c -> jscheid/dtrt-indent@66fc30af02
raxod502/straight.el@653b04a64f -> raxod502/straight.el@e2de88ea0e
2022-03-30 17:49:35 +02:00
Henrik Lissner
dcae7187b4
refactor(lib): doom-info & remove unused commands
- Simplify doom-info and doom/info.
- Remove doom/copy-buffer-contents (may be moved later, but atm not very
  useful).
- Remove doom/am-i-secure (this will later be replaced with CLI
  commands)
2022-03-30 17:32:47 +02:00
Henrik Lissner
615b513a9c dev: add "docs" scope
To refer to documentation "backend" work, as opposed to its contents.
2022-02-02 01:56:04 +01:00
Rafael Varago
1c1ad3a8c8
feat(cli): allow opting-out of deploying git hooks
That's helpful when we need to `doom install` in a non-git directory.

Fix: #5878
Close: #5862
2022-01-27 15:06:45 +01:00
Henrik Lissner
d2da550a14 dev(ci): permit apostrophes in Co-authored-by lines 2022-01-27 03:47:54 +01:00
Henrik Lissner
2132d60062 dev(ci): permit short bump/revert commit messages 2021-12-13 18:48:59 +01:00
Henrik Lissner
9634500a3b fix(cli): update recipe repos (MELPA/ELPA/etc) earlier
If done before we collect our recipe lists, we (hopefully) dodge some
stale-recipe race conditions.
2021-11-22 16:49:43 +01:00
Henrik Lissner
fe2af3c344 fix(cli): don't regraft repo if no repo given
Otherwise you'll regraft $EMACSDIR, which could result in lost data for
contributors.
2021-11-22 16:49:17 +01:00
Henrik Lissner
cc3be7cb44 refactor: simplify native-comp detection
Reduce cases where native-comp procedures were executed in
non-native-comp contexts (somehow).

Also:
- Adds a NATIVECOMP constant for statically detecting the feature.
- Remove native-comp-* -> comp-* aliases (Emacs HEAD has long since
  moved on from these).
- Add 'no-native-compile: t' to autoloads file.
2021-11-22 16:01:02 +01:00
Gerry Agbobada
8d360474ac
docs: add doctor for dev versions of Emacs
The message simply test for the "not-a-version-yet" patch number and
displays an explanation to prepare users for raised error frequency and
having a backup version of Emacs if they do not want to deal with
issues.
2021-11-20 18:32:59 +01:00
Henrik Lissner
bac7ccb970 dev(ci): minor refactor & reformatting 2021-11-04 01:43:50 +01:00
Henrik Lissner
710eab10c7 dev(ci): suppress summary length warnings for bump/revert commits 2021-11-04 01:43:10 +01:00
Henrik Lissner
d6262dd287 dev(ci): check all module dirs for valid scopes
Will become relevant once Doom's modules have been moved to their own
repo.
2021-11-04 01:42:43 +01:00
Itai Y. Efrat
aa2f806b5b dev(ci): fix false negative in commit linter
The one value allowed per trailer check shouldn't apply to names since
they often have spaces.
2021-10-30 19:09:50 +03:00
Itai Y. Efrat
ea18315d08 dev(ci): allow periods in names in commit linter
For initials.
2021-10-30 17:51:28 +03:00
Henrik Lissner
2eaa508121 dev(ci): fix false positive invalid trailers 2021-10-28 14:32:36 +02:00
Henrik Lissner
e4aecd1a5a dev(ci): refactor & update commit linter
This generalizes and cleans up the linter API so that it can be used in
other Doom projects (or CLI commands, like our WIP changelog generator).

Besides that, our git's commit conventions saw two changes:
- A new 'Amend' keyword, for indicating a commit corrects an earlier,
  recent one. This should be used to omit (or merge) commits in the eyes
  of the changelog generator.
- Trailers must now follow the 'KEY: VALUE' format, which is supported
  OOTB by 'git interpret-trailers' and makes scraping them much eacher.
  Before, omitting the colon was mandatory, this is no longer the case.

Other highlights:
- For linter rules: replaced :footer and :refs keys with :trailers (a
  string->string alist). Invalid trailers will be left in BODY's tail.
- Added a linter for colon delimiters in commit trailers (along with
  other formatting checks, like capitalization and one-per-line checks).
2021-10-20 21:37:09 +02:00
Henrik Lissner
6bd7ec7579 dev(ci): generalize commit parser
These will be useful for our various CI facilities later. E.g. our
conventional changelog generator and package bumper CI/CD.
2021-10-18 12:09:42 +02:00
Henrik Lissner
1a86b0fc0f fix(cli): deploy git hooks to correct directory
'doom install' now consults git to find the hooks directory, which will
work for users who have Doom as a submodule (#5632).

Fix #5632
2021-10-18 01:15:54 +02:00
Henrik Lissner
b47440010f docs: add EMACSDIR == DOOMDIR doctor check 2021-10-11 20:25:15 +02:00
Henrik Lissner
432ca05c4f tweak(cli): improve backtrace formatting 2021-10-10 18:36:46 +02:00
Henrik Lissner
3854c2fd70 dev(ci): deploy git hooks on 'doom install' 2021-10-10 18:36:46 +02:00
Henrik Lissner
0b07264619 dev(ci): allow capitalization in revert commits
In case you're reverting an old commit, from before we adopted our git
conventions.
2021-10-06 01:30:45 +02:00
Henrik Lissner
5678a837dd fix(cli): void-variable comp-native-version-dir
There weren't enough checks that we were truly in a native-comp build of
Emacs. Not the most elegant solution, but the CLI rewrite handles this
far better so it'll do for now.

Fix #5131
2021-10-05 02:01:15 +02:00
Henrik Lissner
ea404dfa45 fix(cli): rebuilding packages on every 'doom sync' 2021-10-03 19:24:46 +02:00
Henrik Lissner
328a145ffd fix(cli): void-variable comp-native-version-dir on 'doom purge'
This error would trigger on Emacs 28 (without native-comp).

Fix #5131
2021-10-03 12:08:42 +02:00
Henrik Lissner
49c94dc78c docs(ci): document doom-cli-commit-rules 2021-09-30 15:06:34 +02:00
Henrik Lissner
e9b13393eb dev(ci): fix commit linter receiving empty summary
split-string is not side-effect free. It changes the match data (it uses
regexp to split strings).
2021-09-30 15:06:34 +02:00
Henrik Lissner
1cbd1e14e1 dev(ci): fix commit hash length linter
- Now counts and reports all commit references that aren't the correct
  length, not just the first.
- Now reports all incorrect references, not just the first on each line.
2021-09-29 18:26:10 +02:00
Henrik Lissner
002711ff9b dev(ci): add pre-push git hook
To complain about lingering fixup/squash commits.
2021-09-26 14:35:53 +02:00
Henrik Lissner
dc3eb8a7cf dev(ci): ignore fixup!/squash!/wip commits
Otherwise the commit linter makes rebasing impossible without
--no-verify, or in magit if the git hooks are installed.
2021-09-26 14:35:53 +02:00
Henrik Lissner
2a0aa3d15b dev(ci): fix scope checker in commit linter
- Linter wasn't failing on any invalid scopes due to logic error.
- Linter was failing to recognize module categories as valid
  scopes (e.g. :lang, :ui, etc).
- Adds 'ci' and 'lib' as valid scopes.
2021-09-24 12:37:50 +02:00
Henrik Lissner
14729d21d1 dev(ci): refactor commit message reader for linter 2021-09-17 09:10:37 +02:00
Henrik Lissner
f80eed41bb dev(ci): fix linter complaining about git Ref lines
Such as Co-authored-by: and Signed-off-by: lines.
2021-09-17 09:10:14 +02:00
Henrik Lissner
5aeefc301b dev(ci): fix linter error on tail-less commit msg
If the commit message lacked the diff post-amble, 'doom ci
hook-commit-msg' would throw an out-of-range error.
2021-09-17 09:05:53 +02:00
Henrik Lissner
b3c01226a1 dev(ci): fix linter warning count 2021-09-17 09:05:42 +02:00
Henrik Lissner
650f7a82e3 dev(ci): refactor commit linter
A new approach to make linter rules more flexible.
2021-09-16 20:20:10 +02:00
Henrik Lissner
48239aeb97 fix(cli): git version check on Windows
Of course Git on Windows produces '2.33.0.windows.2'. Why wouldn't it?
2021-09-11 14:26:45 +02:00
Henrik Lissner
abc16ef68c refactor(cli): make all searches case-sensitive
This is more predictable, and is safe as a global default in CLI
sessions (but not in interactive ones). This indirectly fixes case
insensitivity in our commit linter rules.
2021-08-05 12:53:20 -04:00
Henrik Lissner
a3f917c42d dev: fix off-by-one for line length rule 2021-08-04 10:46:10 -04:00