1
0
mirror of https://github.com/magefile/mage.git synced 2026-10-24 06:19:18 +03:00

16 Commits

Author SHA1 Message Date
Nate Finch
3594347101 Set up linter (#539)
* Set up linter

Add .golangci.toml configuration file for linter settings.
2026-03-12 07:54:31 -04:00
Nate Finch
69e6f82473 Add support for optional arguments (#538)
add support for optional args
2026-03-07 19:51:18 -05:00
Horacio Duran
2385abb49a Correct test input code to support older go versions (#490)
Samples used for testing need to have build tags for new and old style:

```
//go:build tag
// +build tag
```

The particular problem here seems to be that 1.16 was actually importing the package referred in the `TestGoModules` test (`import "golang.org/x/text/unicode/norm"`) which, in the CI system's version lacks an old style go tag comment. Hence go complaining of a `//go:build` without a `// +build`. I made all files bi-tagged for consistency.
2023-11-18 18:05:41 +01:00
Dan Kortschak
ae47c82d86 bring docs for use of directives up to date (#407)
* use no-space directive comment syntax in docs

* update build tag mentions in docs to use go:build over +build and make template conform
2022-03-17 20:42:21 -04:00
Nate Finch
0c7e3dee3e filter mageimport files (#281)
When calling mage import, we weren't prefiltering the list of go
files, so we'd get files with build tags and test files and such.
What we want is just the normal go files for building the library.
Using go list returns us that, so use that.
2020-01-13 23:53:11 -05:00
Nate Finch
a7a8e067f4 Support namespace functions with aliases and defaults (#183)
* support namespace funcs as aliases and defaults

fixes #181
2018-09-25 23:46:37 -04:00
fazal
b853551298 Check for duplicates with namespace prefixed if any (#137)
Check for duplicates with namespace prefixed if any
2018-08-26 09:11:00 -04:00
Nate Finch
0b004e8e5c Fix panic in 126 (#127)
fix #126
2018-07-23 16:50:53 -04:00
Ryan Faerman
c807db8c20 Add namespace/subcommand support to Mage (#121)
Introduce an exported Namespace type in mg and use it to generate new targets.
2018-07-22 21:23:34 -04:00
Sunny
63768081a3 parse: sanitize function doc synopsis (#95)
This change adds `sanitizeSynopsis()` function to perform basic
sanitization on the synopsis. If synopsis begins with the function name, it
removes the function to avoid repeating words.
2017-12-29 07:42:55 -05:00
Marcin Białoń
898127b487 Support for aliases (#58) (#90) 2017-11-06 23:42:24 -05:00
Nate Finch
be7943de50 Support multiple targets (#65)
* support multiple targets

* fix #66

* isolated list test

* add clean target to mage's magefile
2017-10-18 10:40:37 -04:00
James S
df367221b6 context for jobs (#32)
Allows for jobs that take and call with a context.  Closes #25
2017-10-17 23:57:04 -04:00
Nate Finch
8b6c4f7a9d fixes and a test (#15)
fixes #13 

The bug was that non-stdlib imports were failing to be found by the parser.

The problem is that the default importer only imports from compiled files.  But we specifically want to import from source files. For go 1.9 this is easy, go/importer has an importer.For that takes "source".  However, previous to go 1.9, this doesn't exist.  To keep the code working in previous versions, we just grab the code from 1.9's srcimporter and include it in the build, and then conditionally compile in that code if we're not running on go 1.9 or greater (if we are running on go 1.9, we can use the stdlib version, which is better because it'll get fixes etc automatically).

Also added a bunch of tests to ensure that this code won't break again without a test failing.
2017-09-29 09:38:37 -04:00
Nate Finch
9dc8074005 implments configurable default targets (#7) 2017-09-27 00:05:03 -04:00
Nate Finch
d95f2a0d68 works now 2017-09-22 11:27:23 -04:00