-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline support for Toolkit Annotations #193
Comments
+1 At least some kind of initial feedback. Is it possible or not? And then maybe follow up with updating the docs. |
+1. This is one of the last blocking issues blocking me from moving to Github Actions. The output of my test suites failures are much longer than a single line, and I have no way to display them nicely. |
It can be achieved by using urlencoded newline I learned it from a comment by @PoisonousJohn at actions/starter-workflows#68 (comment) I've confirmed it working for PHPUnit output and have a PR: https://github.com/mheap/phpunit-github-actions-printer/pull/14/files And here's a screenshot of the outcome: https://i.imgur.com/nnSCPTG.png Zero documentation anywhere, thank you @PoisonousJohn ! |
I just discovered this, Cheers! PS. @BrianHenryIE Have you discovered a way to make problem matchers work with multi-line messages? |
Apparently you can include newlines in GitHub Actions errors and warnings by using "%0A". actions/toolkit#193 (comment)
Apparently this is not possible although the regex has been confirmed to work, both using \n\n and url-encoded %0A%0A. See also actions/toolkit#193 Split warning messages are better than none, one will look into the logs anyway. This reverts commit 58bdefe.
Wow, such an important feature and the only way to solve it is via an undocumented hack. Why not just use a json object printed on one line, which can be readily produced with e.g. jq? Is this the quality standard the Github Actions team wants to stay at? |
* Fix typo SCIP->SCPI * Fix SCPI used for Keithley 2400 voltage NPLC * Add pendulum CNT-91 frequency counter. (pymeasure#508) Add pendulum CNT91 frequency counter. Add functionality for frequency time series and some basic operations. * Update release workflow Reflect the fact that the feedstock nowadays pulls from PyPI, not Github conda-forge/pymeasure-feedstock#31 conda-forge/pymeasure-feedstock#32 * Fix missing return statements. * Apply black to fix missing blank lines. * Remove unused import. * Update __init__.py * Add files via upload * Update index.rst * Create anritsuMS9740A.rst * Delete AnritsuMS9740A.py * Add files via upload * Delete AnritsuMS9710C.py * Add files via upload * Update __init__.py * Keithley 2400: Allow assigning "ONCE" to auto_zero * Keithley 2400: Add line frequency controls (pymeasure#524) Keithley 2400: Add line frequency controls * Add Rohde&Schwarz FSL spectrum analyzer. (pymeasure#511) * updated filenames and docs * minor updates per comments. * changed the instance attribute 'idn' to an Instrument.control property called address. * removed async methods, added the busy property to query if the controller is moving a motor. * changed the current position property to step_position and added the absolute_position property. Interaction with this property should be defined in subclasses. * Added an IntFlag subclass to decode errors so that user does not need to refer to the manual to understand error codes. * fixed syntax error in error_reg definition * added check_errors() function to log errors returned by the error_reg property. Introduced the step_position and absolute_position properties * added home() method * changed self.write('G') in step() method to self.go() so that user only needs to override go() in the application layer to acheive concurrency. * Fixes error in Keithley2600.error when error code is returned in scientific notation. * removed **kwargs from ask() overridden method as the base class has no kwargs. * fixed formatting in docstrings and added wait_for_completion() method. This method just blocks until the controller is not 'busy.' * modified the step_position property to return an integer * updated dpseriesstepmotorcontroller home() docstring and added anaheimautomation/index to the instruments index file * Update docs/api/instruments/anaheimautomation/dpseriesstepmotorcontroller.rst Co-authored-by: Christoph Buchner <[email protected]> * Update pymeasure/instruments/anaheimautomation/dpseriesmotorcontroller.py committing suggested change from @bilderbuchi Co-authored-by: Christoph Buchner <[email protected]> * implemented changes suggested by @bilderbuchi * Update authors.rst * Update AUTHORS.txt * Changed all get_process int casts to cast=int and changed the step_position setter to use the strict_range validator. * Update docs/api/instruments/anritsu/anritsuMS9740A.rst Co-authored-by: Christoph Buchner <[email protected]> * Update and rename AnritsuMS9740A.py to anritsuMS9740A.py * Update anritsuMS9740A.py * Update anritsuMS9740A.py * Fix indentation error * Update anritsuMS9710C.py * Use sphinx-problem-matcher, too. This way we should also catch sphinx errors outside of docstrings. Note: The line number of docstring warnings is not contained in the warning message, so it's not possible to annotate such a warning at the correct location in the file. See also sphinx-doc/sphinx#6036 * Add flake8 problem matcher. * Add a pytest warning problem matcher. * Try to match multiline pytest warnings. * Revert "Try to match multiline pytest warnings." Apparently this is not possible although the regex has been confirmed to work, both using \n\n and url-encoded %0A%0A. See also actions/toolkit#193 Split warning messages are better than none, one will look into the logs anyway. This reverts commit 58bdefe. * Fix small error caught by flake8. * Remove Python 3.6 from CI. It's EOL and current PyQtgraph does not support it. * Bump CI versions of pyqtgraph and pyvisa. * Remove broken methods in experiment.py. * Fix invalid escape warning. * Move flake8 config to setup.cfg. This way, editors can use the same configuration as CI. * Linter: Fix indentation problems (E1). The commmand used was autopep8 --in-place -r --max-line-length=100 --select E1 . * Let's go with a line length of 100. * Linter: Fix trailing whitespace, too few or many blank lines. W29,W39,E3 * Linter: Fix whitespace problems (E2). * fix Attocube ANC300 with new SCPI Instrument properties in commit bbc0354 the not implemented SCPI properties were changed to emit an error. The properties of an instrument can therefore not be browsed anymore as before which made a code change in the Attocube code necessary. * Linter: Fix some line-too-long problems (E501). * Linter: Fix whitespace problems. (W29) * Linter: Fix last issues with autopep8. From now on it seems to be manual work. Used autopep8 --in-place -r --max-line-length=100 --ignore E402 . E402 fixes looked weird/wrong, so were ignored. * Linter: Fix reports in examples/*. * Linter: Fix reports in adapters/*. * Linter: Fix reports in display/*. * Linter: Fix reports in experiment/*. * Linter: Fix reports in tests/*. * Linter: Fix reports in instruments/*. * Remove unneeded computation of inverse map in setting factory. * Bump the max complexity setting. It's now a little above the level of Instrument.control, which is not _that_ complex. This should mainly guard against wildly complex methods. * Simplify Results.parse_header * Refactor DSP7265.buffer_to_float() to bring its complexity down. Before, it was the most complex function in the codebase, by far. * Add docs on flake8 usage and update the pull request section. * Remove references to Python 3.6. * Address review comments. * Remove safeKeywords from VISAAdapter (pymeasure#536) Implemented by @msmttchr * Removed unused code By chance I stumbled upon this code that isn't used anywhere apparently, so I propose to remove it. * Enable flexible configuration of connection settings. Instrument implementations pass in dicts, processing happens within VISAAdapter. Make it possible to override instrument-specific defaults. Add tests demonstrating usage. Update pyvisa CI version to latest. * Add docs and docstrings for connection setting best practices. * Use best practice for instrument connection settings that I could find. * Switch on Python 3.10 testing. * Cast progressbar value explicitly to int. Avoid implicit conversion from float to integer, see https://bugs.python.org/issue36048 Fixes pymeasure#531. * Bump CI requirements to Python 3.10 compatibility. * Fix linter report. * Clarify some code, add a test for interface typo. * Clarify docstring of joined_validators and strict_range. * Added management of progress bar In the examples, add also management of progress bar to address misunderstanding similar to those reported in pymeasure#531 (comment) Implement solution proposed by @CasperSchippers * Fix docstring formulation. * Move write delay to the instrument itself * Implement new flexible default connection-settings * Remove test for write-delay * Fix linting issues * Fix linter reports and tweak docstring indentation. * Change default communication settings to single-interface format * Added HP8116A instrument class * Added a few basic setters * Unit parsing & some basic controls * Improved docstrings * Added controls which are string properties * Added boolean controls * Added Option 001 controls * Added GPIB status byte & corrected flake8 issues * Added a few unit tests and a method to check for option 001 * Automatic decision about the response length based on the command * Implemented check_errors() * Added 8116A to docs * Added a method to control the autovernier * Prefixed private methods with underscore & restructuring * Error message update Co-authored-by: Christoph Buchner <[email protected]> * Updated error message Co-authored-by: Christoph Buchner <[email protected]> * New Instrument: Toptica Smart Laser diode (pymeasure#352) Toptica IBeam Smart Laser diode instrument implementation. This instrument uses a weird communication protocol which sends a CR+LF reply after every set command. Additionally a query and set command are acknowledged always by a [OK] reply. A custom adapter is implemented that deals with this. Co-authored-by: Christoph Buchner <[email protected]> * Keithley 2306 Dual Channel Battery/Charger Simulator (pymeasure#529) Add Keithley 2306 Dual Channel Battery/Charger Simulator. Also add a test suite to check implementation with a connected instrument. See pymeasure#529. * Removed staticmethod from _boolean_control for python<3.10 compatibility * Remove errorbars * Simplified code structure Enhancement and bug fixing to doc strings Removed obscure code for reading functions parameters list Removed module global variables to make class DynamicProperty reusable Reordered and renamed parameter list for DynamicProperty class Removed special_keys class variables and replaced with two list for fget and fset Extended command_process to set commands to be uniform. Very important removed use of dynamic parameter, now all Instrument.control/measurement/setting are dynamic by default. dynamic parameter documentation left in the code, if changes are accepted be removed after review. Simplified definition of fget and fset functions * new Instruments: Andeen Hagerling capacitance bridges (pymeasure#535) Add new Instruments: Andeen Hagerling capacitance bridges. * Added back usage of dynamic parameter Also more structured testing (credit to @bilderbuchi) * Updated copyright & fixed spelling * Typo in docstring Co-authored-by: Casper Schippers <[email protected]> * Typo in docstring Co-authored-by: Casper Schippers <[email protected]> * Improved English in documentation Thanks to @CaspersShippers!!! Co-authored-by: Casper Schippers <[email protected]> * English improvement Co-authored-by: Casper Schippers <[email protected]> * Documentation update and minor code changes Default parameters value set to None instead of mutable object Enhanced error messages clarity Use of __mro__ instead of method mro. docstring improvements * Update pymeasure/instruments/instrument.py Co-authored-by: Christoph Buchner <[email protected]> * Further enhancements Simplified exception messages Internal method name change to highlight the side effects Appended string "(dynamic)" to docstring. * Fix linter report. * Change copyright date to 2022 (pymeasure#572) * Update adding_instruments.rst (#5) * Update adding_instruments.rst * Update adding_instruments.rst * Updated documentation after review * Updated documentation after review * Editing pass on new documentation. * Modernise the code base to use Python 3.7 features. This mainly starts using f-strings and .format instead of the % notation, and removes superfluous super() arguments. Used the pyupgrade tool to do this: "find . -name '*.py' -exec pyupgrade --py37-plus {} +" * Modernise the code base to use Python 3.7 features. (pymeasure#577) This mainly starts using f-strings and .format instead of the % notation, and removes superfluous super() arguments. Used the pyupgrade tool to do this: "find . -name '*.py' -exec pyupgrade --py37-plus {} +" * Added image data generation to Mock Instrument class (pymeasure#552) Create methods to return single channel mock image data with specified width, height, and bit depth Maintenance around Mocks/fakes: Updated Mock to inherit from FakeInstrument, rename to SwissArmyFake, put new functionality there. Removed SwissArmyFake and FakeInstrument from the Instrument namespace. Remove __getitem__ from SwissArmyFake. This was originally introduced (in a suspected nonfunctional manner) in 3c5c158, but its current purpose is unknown. Co-authored-by: Christoph Buchner <[email protected]> * Heidenhain ND287 Position Display Unit Driver (pymeasure#534) * configured directory widget to launch at currently entered directory * Added ManagedWindowBase kwarg to set default dir * removed default_directory_path param from ManagedWindowBase, added directory setter * string-ify input value in directory setter * Updated directory section of docs * Added myself to authors.rst and AUTHORS.txt * Add autodoc warnings to the problem matcher. This should enable us to at least flag autodoc import errors in the diff view. Catching error otherwise is not feasible, see pymeasure#583. * CI: Make warnings fail the docs_lint job. This is the only way to reliably surface sphinx-autodoc warnings. Failing lint steps don't stop the job execution, and despite a failing docs_lint job the test job still runs, to maximize received feedback. * Fix pylint report. * Correctly include fake instruments in the docs. * New instruments: Oxford IPS120-10 and PS120-10 (pymeasure#459) Includes a number of useful properties. Uses a custom retrying adapter with reply checking to account for device-specific communication protocol. PS120_10 is derived from IPS120_10 and only implements the differences using the new dynamic property feature. Co-authored-by: Benjamin Klebel <[email protected]> * Move to using OxfordInstrumentsAdapter and move init to front of class * Linting * Make use of dynamic property for temperature_range * Make use of dynamic property for temperature_range * fix mistake with using dynamic property * Correct usage of dynamic properties Apparently it is not possible to modify the values list of a dynamic property since that requires getting the value (which is forbidden) * Fix typo * Enable the OxfordInstrumentsAdapter to handle signed numbers * Remove "$" from commands * Fix issue where the status and version commands didn't match the regex for validation (The "X" and "V" command both have a different response compared from the other commands) * Implement preprocess reply * Small update to docs of the IPS * Removed error checking from wait_for_idle ifn IPS120_10 as this is an intrinsic part of the OxfordInstrumentsAdapter * Breakout widgets into separate modules. Auto-import current modules at pymeasure/display/widgets/__init__.py for backwards compatibility * fix linting errors in browser_widget.py and plot_frame.py * fix linting errors in __init__.py * changed self.address to self._address in the ask() write() and values() methods. In the previous case, collisions on the serial line are caused when multiple motor controllers are connected on the same serial line. * ran a sphinx and fixed all reported broken links. * Add Keysight N7776C Swept Laser Source (pymeasure#499) Co-authored-by: Christoph Buchner <[email protected]> * Added copyright to file * Added submodules to widgets.rst and updated docstrings in widget modules. * fix linting in docstrings and spelling errors * Fix spelling error * Changed docstring for ResultsDialog * Increase timeout from 4 or 5 seconds to 20 to account for slow github action containers worker.join(timeout=20.0) * Increasing sleep time for listener prevented errors in \`test_zmq_topic_filtering_works()\` for 40 runs * json format works" * fix to reload for JSON outputfmt * allow port to be None from ManagedWindow * sequences work with json formatter * sequences work with json formatter * can now sequential json add * gui loads * basic functionality demonstrated * gui loads * added some analysis abort buttons * fixed abort analysis behavior * minor fixes * fail loudly * fail mildly * fix case hierarchy * fix jsonification in resluts * add new safe function to sequencer widget * import error fix * remove analyses when done * modification to allow routines to do analyze when not finished * more hacks to make fatigue work * minor fix to json formatting to deal with race conditions * minor debug fixes * fixes to keithley2600 * more robush json reload retry * chunk defined * minor optimiization to transfer and load * fix to bn675 driver * try except in minicircuits adapter Co-authored-by: Mike Fikes <[email protected]> Co-authored-by: Michele Sardo <[email protected]> Co-authored-by: Bastian Leykauf <[email protected]> Co-authored-by: Casper Schippers <[email protected]> Co-authored-by: Christoph Buchner <[email protected]> Co-authored-by: md12g12 <[email protected]> Co-authored-by: mcdo0486 <[email protected]> Co-authored-by: samcondon4 <[email protected]> Co-authored-by: Brian Carlsen <[email protected]> Co-authored-by: Christoph Buchner <[email protected]> Co-authored-by: Dominik Kriegner <[email protected]> Co-authored-by: Michele Sardo <[email protected]> Co-authored-by: CodingMarco <[email protected]> Co-authored-by: Robert <[email protected]> Co-authored-by: jarvas24 <[email protected]> Co-authored-by: Benjamin Klebel <[email protected]> Co-authored-by: spherex <spherex> Co-authored-by: Andreas Maeder <[email protected]> Co-authored-by: neal-kepler <[email protected]>
The same trick can be used in |
…tion for `config.yml` and `conandata.yml` * first attempt at a yaml linter wit github actions output * This is less strict but has more information * fixup message * run config linter in Action * better ux feedback * try to use newlines actions/toolkit#193 (comment) * clean up * fixup file name * trying custom class for quoted str * underlying yaml parser does not keep quotes * trying to catch ints as problems * remove test code * and to "linter testing" * install deps * run new linter unconditionally * revert testing changes * new script for conandata (this one is much harder to spec) * debugging * lets see all the errors * yamale -s ../linter/config_yaml_schema.yml aaf/config.yml from linters folder as a test * adjust script to match meeting discussion * make sure the docs and linters match * fix link * Update conandata.yml * exit 1 is not needed with annotations * add annotation matchers for yaml since those do do much * fix search for type * fix whitespace * tryout a yamllint file with a better looking matcher * copy syntax from readme * test if it's running in the wrong dir 🤔 * try with debug output * bump since i dont have permissions * bump - dont glob star * bump * less star globs * also add action to conandata way * bump * drop action for cli + matcher * more docs around linters * fix file and name * cleanup
The toolkit/packages/core/src/command.ts Lines 80 to 85 in 7b617c2
|
According to [0] & [1] all is needed is to urlencode newlines! [0]: actions/starter-workflows#68 (comment) [1]: actions/toolkit#193
@rhaschke It seems the |
For me, the multi-line output is only shown correctly when clicking "show more". Without that expansion, everything shows up in a single line, doesn't it? |
@rhaschke Yes, you observation is right. |
Is there any actual way that works here? |
To confirm @rhaschke observation above: the Hopefully, this is something GitHub can fix. - name: Test
run: |
echo "::error::Example of a short multi-line error%0Awith a few lines%0Aof text."
echo "::error::Example of a long multi-line error%0Awith quite a few long lines of text that will end up%0Arequiring the Show More link to display the entire%0Aerror message in the GitHub Annotations pane,%0Awhich will display properly as a multi-line error." ![]() ![]() |
This is a follow-up issue started at #186 (comment).
It is unclear from the recently added Annotation docs if
::debug
/::warning
/::error
messages support multiline text in the{message}
placeholder.Why it is important? These Annotations can be used by various code linters and other similar tools, but their output easily could be spanned to multiple lines, for example:
pylint output:
Rust compiler output:
It would be nice to clarify if it is possible to use multiline strings over there and it is expected to be working correctly in the future.
The text was updated successfully, but these errors were encountered: